blobfish
v1.4.22
Published
File sync between GitHub repos
Downloads
34
Readme
blobfish
This package allows you to dynamically sync files between GitHub repositories.
🐡 Install
You can install this with:
npm i -D blobfish
🐡 Usage
Run the following command in your project root folder:
npx blobfish init
You can also install blobfish globally by running
npm i -g blobfish
and then run justblobfish init
, if you prefer.
Or, manually create a .blobfishrc
file in your project root folder. Here's an example of the JSON file:
{
"replications": [
{
"repository": "cool-org/awesome-repo",
"files": [
"path/to/file.js",
{
"from": "path/to/another_file.js",
"to": "target/path/to/another_file.js"
}
]
}
],
"comment": "// This is a generated file"
}
Specifying the
from
andto
fields allows you to copy the file to a different path in the target repository, but if you only provide the filename, the path will be the same as the original file.
If the comment
field is present, it overrides the original auto-generated comment.
You can use
{{url}}
in thecomment
to add the URL of the repository to your custom comment.
However, if you wish to keep the original comment but change the delimiter, you can add the commentDelimiter
field instead, like: "commentDelimiter": "#"
.
Make sure you already have a GitHub personal access token with the repository
scope. You can create one here.
Then, create a .env
file in your project root folder with the following content:
GH_TOKEN=<your_token>
You can also set the
GH_TOKEN
environment variable directly.
Then, run the following command to sync your files:
npx blobfish sync
You can also run the blobfish sync
command with the --token
flag if you don't want to use a .env
file:
npx blobfish sync --token <your_token>
And that's it! Your files will be copied to the specified repositories.