guide201
Version:
Atlas is living style-guides & pattern library static site generator with extensive CSS monitoring and components info that could be used virtually with any scss/css project
36 lines (32 loc) • 976 B
JavaScript
const parseOption = arg => arg.split(/=/);
const arg = parseOption(process.argv[2]);
try {
switch (arg[0]) {
case '--build':
case '-b':
require('../app/atlas-guide').withConfig(arg[1]).buildAll();
break;
case '--version':
case '-v':
console.log('atlas-guide ' + require('../package').version);
break;
case '--help':
default:
console.log(`
Usage: atlas-guide [OPTION]
Options:
-b, --build=FILE build all atlas pages, followed with config '--build=./path/to/config.json'
-v, --version print Atlas-guide version
--help print this message
`);
}
} catch (e) {
if (e.code === 'ENOENT') {
console.error('Error: no such file or directory "' + e.path + '"');
} else {
console.error('Error: ' + e.message);
}
process.exit(1);
}
;