diff --git a/bin/sync-cli b/bin/sync-cli new file mode 100755 index 0000000..693e804 --- /dev/null +++ b/bin/sync-cli @@ -0,0 +1,3 @@ +#! /usr/bin/env node +require = require('esm')(module) +require('./sync.js') // iife diff --git a/bin/sync-cli.js b/bin/sync-cli.js deleted file mode 100644 index 5e86de6..0000000 --- a/bin/sync-cli.js +++ /dev/null @@ -1,3 +0,0 @@ -// Set options as a parameter, environment variable, or rc file. -require = require('esm')(module) -module.exports = require('./sync.js') diff --git a/bin/sync.js b/bin/sync.js old mode 100644 new mode 100755 diff --git a/package.json b/package.json index 65d9a99..b2b6414 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "@uci-utils/sync", - "version": "0.0.6", + "version": "0.0.7", "description": "module to copy, maintain, and launch hardware modules on other machines", "main": "src/index.js", "bin": { - "syncu": "./bin/sync.js" + "syncu": "./bin/sync-cli" }, "scripts": { "sync": "node -r esm ./bin/sync", diff --git a/src/sync.js b/src/sync.js index 90ecd10..481e354 100644 --- a/src/sync.js +++ b/src/sync.js @@ -236,6 +236,7 @@ class Sync extends merge(Rsync, Emitter) { } if (errors) log.warn({errors: errors, cmd:cmd, msg:'sync ran but with with errors'}) log.info({cmd:cmd, status:status, msg:'sync run'}) + if (!errors) this.emit('sync',status) resolve({cmd:cmd, errors:errors, status:status, msg:'sync run'}) }, function(data) { status += data.toString()