- Cython 98.1%
- JavaScript 1.9%
| assets | ||
| .gitignore | ||
| .nvmrc | ||
| config.example.js | ||
| index.js | ||
| readme.md | ||
Ash Fetchum - Gotta Fetch 'Em All
What does it do?
It gets a list of all your repositories on Forgejo or GitHub then either clones them if they don't exist, or fetches the most recent changes. Alternatively, you can define a list of repos and their SSH urls to clone just those.
Usage
Ash Fetchum supports Forgejo and GitHub because that's the two services I use. It should be easy enough to add other services but I don't use them, so I didn't. It assumes you clone and fetch your repositories via ssh and have that setup on the machine Ash Fetchum is running on. I built this as a way to backup all my repositories to my home server which is then backed up elsewhere.
To get started:
- Copy
config.example.jsasconfig.jsor create a newconfig.jsfile. - In that file, set up each service you want to clone repositories from and keep up to date. The example file shows what is required for each service. Pay attention to the permissions needed for tokens.
- Run
npm install- I'm using v25 but it should work with lower versions anyway. - Run
node index.jsto clone or fetch your repositories. - Set up
node index.json a schedule to keep all your repos fresh.
You optionally pass a custom config path as the third argument if your config exists outside the root:
node index.js /my/custom/path/config.js
Warnings
- If two services have a repo with the same name, only the first one will get cloned/fetched.
Adding other services
If one wanted to add another service, one need only to add a new if (service.type === 'new-service'), fetch repositories, then map them to an object like below and add that code to index.js.
{
name: 'name-of-repo',
sshUrl: 'git@example.com:username/name-of-repo.git',
skip: false,
}
