-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathbower-locker.js
More file actions
33 lines (28 loc) · 1.12 KB
/
bower-locker.js
File metadata and controls
33 lines (28 loc) · 1.12 KB
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
31
32
33
#!/usr/bin/env node
'use strict';
var program = require('commander');
var lockerLock = require('./bower-locker-lock.js');
var lockerValidate = require('./bower-locker-validate.js');
var lockerUnlock = require('./bower-locker-unlock.js');
var lockerStatus = require('./bower-locker-status.js');
var bowerLocker = {
lock: lockerLock,
unlock: lockerUnlock,
validate: lockerValidate,
status: lockerStatus
};
program
.command('lock', 'lock the current bower usage in a new bower.json')
.command('unlock', 'unlock the current bower usage back to the original bower.json')
.command('validate', 'validate that the currently locked bower.json matches the bower_components')
.command('status', 'show the current status of the bower.json whether locked or not')
.option('-v, --verbose', 'turn on verbose output')
.action(function(cmd) {
if (cmd in bowerLocker) {
return bowerLocker[cmd](program.verbose);
} else {
console.error("Unknown bower-lock command. Run 'bower-lock -h' to see options.");
process.exit(1);
}
});
program.parse(process.argv);