md-sync
v0.2.0
Published
Multiple destinations syncing(sync local files or directories to multiple destinations).
Downloads
3
Maintainers
Readme
md-sync
Multiple destinations syncing(sync local files or directories to multiple destinations).
npm install md-sync --save-dev
package.json
"scripts": {
"sync": "md-sync"
}
config
Add a md-sync.config.js
file to your project root.
module.exports = [
// first destination
{
src: [globs, options],
remotePath: 'remotePath',
server: {
ignoreErrors: true,
sshConfig: {
host: 'host',
username: 'username',
password: 'password'
}
},
},
// second destination
...
];
multiple server environments
If you need to support multiple server environments(test
, gray
, prod
), you can do like this:
# package.json
"scripts": {
"sync:test": "md-sync --env test",
"sync:gray": "md-sync --env gray",
"sync:prod": "md-sync --env prod"
}
With minimist.
# md-sync.config.js
const argv = require('minimist')(process.argv.slice(2));
const configs = {
test: [
{ ... },
...
],
gray: [
{ ... },
...
],
prod: [
{ ... },
...
],
};
module.exports = configs[argv.env];
do syncing
npm run sync