mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
allow "npm link" of the tool (#4974)
This commit is contained in:
committed by
Eugenio Romano
parent
8adb9b2a25
commit
e8f179e84d
1
lib/cli/bin/.gitignore
vendored
Normal file
1
lib/cli/bin/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
scripts
|
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
// tslint:disable: no-var-requires adf-file-name
|
||||||
|
|
||||||
const minimist = require('minimist');
|
const minimist = require('minimist');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
@@ -6,12 +8,11 @@ const args = minimist(process.argv.slice(2), {
|
|||||||
boolean: ['verbose']
|
boolean: ['verbose']
|
||||||
});
|
});
|
||||||
const scriptName = args._.shift();
|
const scriptName = args._.shift();
|
||||||
const scriptPath = path.join('../scripts', scriptName);
|
const scriptPath = path.join(__dirname, 'scripts', scriptName);
|
||||||
|
|
||||||
const cwd = process.cwd();
|
const cwd = process.cwd();
|
||||||
process.chdir(path.join(__dirname, '..'));
|
process.chdir(path.join(__dirname, '..'));
|
||||||
|
|
||||||
|
|
||||||
// This might get awkward, so we fallback to console if there was an error.
|
// This might get awkward, so we fallback to console if there was an error.
|
||||||
let logger = null;
|
let logger = null;
|
||||||
try {
|
try {
|
||||||
@@ -29,6 +30,7 @@ try {
|
|||||||
case 'warn': color = yellow; break;
|
case 'warn': color = yellow; break;
|
||||||
case 'error': color = red; output = process.stderr; break;
|
case 'error': color = red; output = process.stderr; break;
|
||||||
case 'fatal': color = x => bold(red(x)); output = process.stderr; break;
|
case 'fatal': color = x => bold(red(x)); output = process.stderr; break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
output.write(color(entry.message) + '\n');
|
output.write(color(entry.message) + '\n');
|
||||||
@@ -41,11 +43,10 @@ try {
|
|||||||
warn: console.warn.bind(console),
|
warn: console.warn.bind(console),
|
||||||
error: console.error.bind(console),
|
error: console.error.bind(console),
|
||||||
fatal: x => { console.error(x); process.exit(100); },
|
fatal: x => { console.error(x); process.exit(100); },
|
||||||
createChild: () => logger,
|
createChild: () => logger
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Promise.resolve()
|
Promise.resolve()
|
||||||
.then(() => require(scriptPath).default(args, logger, cwd))
|
.then(() => require(scriptPath).default(args, logger, cwd))
|
||||||
|
3432
lib/cli/package-lock.json
generated
3432
lib/cli/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -16,8 +16,9 @@
|
|||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build-tsc": "tsc -p tsconfig.json",
|
"build": "npm run build-tsc",
|
||||||
"dist": "rm -rf ./dist/ && npm run build-tsc && cp -R ./bin ./dist/ && cp ./package.json ./dist/"
|
"build-tsc": "rm -rf ./bin/scripts && tsc -p tsconfig.json",
|
||||||
|
"dist": "rm -rf ./dist/ && npm run build && cp -R ./bin ./dist/ && cp ./package.json ./dist/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^2.15.1",
|
"commander": "^2.15.1",
|
||||||
@@ -27,7 +28,8 @@
|
|||||||
"rxjs": ">=6.2.2",
|
"rxjs": ">=6.2.2",
|
||||||
"shelljs": "^0.8.3",
|
"shelljs": "^0.8.3",
|
||||||
"spdx-license-list": "^5.0.0",
|
"spdx-license-list": "^5.0.0",
|
||||||
"ejs": "^2.6.1"
|
"ejs": "^2.6.1",
|
||||||
|
"typescript": "3.1.6"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"alfresco-component"
|
"alfresco-component"
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
"noImplicitThis": true,
|
"noImplicitThis": true,
|
||||||
"noUnusedParameters": false, // The linter is used for these.
|
"noUnusedParameters": false, // The linter is used for these.
|
||||||
"noUnusedLocals": false, // The linter is used for these.
|
"noUnusedLocals": false, // The linter is used for these.
|
||||||
"outDir": "./dist",
|
"outDir": "./bin",
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
Reference in New Issue
Block a user