forked from nodejs/node-core-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.js
More file actions
30 lines (25 loc) · 681 Bytes
/
sync.js
File metadata and controls
30 lines (25 loc) · 681 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';
const CLI = require('../../lib/cli');
const { runPromise } = require('../../lib/run');
const SyncSession = require('../../lib/sync_session');
function builder(yargs) {
return yargs
.epilogue('Demo: https://asciinema.org/a/221230')
.wrap(90);
}
async function main() {
const logStream = process.stdout.isTTY ? process.stdout : process.stderr;
const cli = new CLI(logStream);
const dir = process.cwd();
const session = new SyncSession(cli, dir);
await session.sync();
}
function handler(argv) {
return runPromise(main());
}
module.exports = {
command: 'sync',
describe: 'Sync the branch specified by ncu-config.',
builder,
handler
};