mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
# add dist
This commit is contained in:
41
ng2-components/ng2-alfresco-documentslist/dist/node_modules/strip-json-comments/cli.js
generated
vendored
Executable file
41
ng2-components/ng2-alfresco-documentslist/dist/node_modules/strip-json-comments/cli.js
generated
vendored
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
var fs = require('fs');
|
||||
var strip = require('./strip-json-comments');
|
||||
var input = process.argv[2];
|
||||
|
||||
|
||||
function getStdin(cb) {
|
||||
var ret = '';
|
||||
|
||||
process.stdin.setEncoding('utf8');
|
||||
|
||||
process.stdin.on('data', function (data) {
|
||||
ret += data;
|
||||
});
|
||||
|
||||
process.stdin.on('end', function () {
|
||||
cb(ret);
|
||||
});
|
||||
}
|
||||
|
||||
if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
|
||||
console.log('strip-json-comments input-file > output-file');
|
||||
console.log('or');
|
||||
console.log('strip-json-comments < input-file > output-file');
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) {
|
||||
console.log(require('./package').version);
|
||||
return;
|
||||
}
|
||||
|
||||
if (input) {
|
||||
process.stdout.write(strip(fs.readFileSync(input, 'utf8')));
|
||||
return;
|
||||
}
|
||||
|
||||
getStdin(function (data) {
|
||||
process.stdout.write(strip(data));
|
||||
});
|
Reference in New Issue
Block a user