0.0.5 • Published 4 years ago

git-cached-copy v0.0.5

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
4 years ago

git-cached-copy

Copies files from remote git repositories to your local filesystem.

Features:

  • Allows specified mapping
  • Only updates when commit hash has changed (cache)

Usage

Create a configuration file named .git-cached-copy.config.json, and save this in the root directory of your project. See the Configuration File section for details.

Run this tool:

npx git-cached-copy

The output will indicate if any relevant changes were detected in the remote repositories, and which files were updated.

You may, optionally, create a file with a different name, in which case you should specify it as the first argument, like so:

npx git-cached-copy my-config.json

Configuration File

{
  "projects": [
    {
      "id": "my-repo",
      "gitUrl": "git@github.com:my-user/my-repo.git",
      "httpUrl": "https://raw.githubusercontent.com/my-user/my-repo",
      "localPath": "/home/my-user/my-repo",
      "head": "refs/heads/master",
      "commit": null,
      "commands": [
        {
          "name": "copySingle",
          "remoteFilePath": "README.md",
          "localFilePath": "some/nested/path/my-repo.md",
          "localPreserveFrontMatter": true,
          "remotePreserveFrontMatter": false
        }
      ]
    }
  ]
}

If this file is committed into a repository of its own, you are recommended to omit localPath, as it will default to the directory from which the tool is run. The localPath option exists only to override said default.

The value of commit will be overwritten by the git commit hash each time this tool is run, if the remote repository being copied from has changed.

Between localPreserveFrontMatter and remotePreserveFrontMatter, only one may be true.

Licence

GPL-3.0

Author

Brendan Graetz

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago