Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
d5d347721a | |||
6a047d6333 | |||
6e7b4dd18e | |||
debc5f1524 | |||
8d03561762 | |||
f516a6e753 | |||
1c4f6a8bf9 | |||
4fe3775904 |
@ -26,6 +26,7 @@ mirror:
|
||||
snyk:
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
@ -36,21 +37,11 @@ snyk:
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install legacy
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
@ -62,6 +53,7 @@ testLTS:
|
||||
testSTABLE:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
@ -118,6 +110,7 @@ pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g typedoc typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
||||
tags:
|
||||
@ -130,13 +123,3 @@ pages:
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
||||
|
||||
windowsCompatibility:
|
||||
image: stefanscherer/node-windows:10-build-tools
|
||||
stage: metadata
|
||||
script:
|
||||
- npm install & npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- windows
|
||||
allow_failure: true
|
||||
|
14
package-lock.json
generated
14
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartshell",
|
||||
"version": "2.0.7",
|
||||
"version": "2.0.11",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -210,9 +210,9 @@
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "10.12.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.0.tgz",
|
||||
"integrity": "sha512-3TUHC3jsBAB7qVRGxT6lWyYo2v96BMmD2PTcl47H25Lu7UXtFH/2qqmKiVrnel6Ne//0TFYf6uvNX+HW2FRkLQ==",
|
||||
"version": "10.12.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.10.tgz",
|
||||
"integrity": "sha512-8xZEYckCbUVgK8Eg7lf5Iy4COKJ5uXlnIOnePN0WUwSQggy9tolM+tDJf7wMOnT/JT/W9xDYIaYggt3mRV2O5w==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/vinyl": {
|
||||
@ -963,9 +963,9 @@
|
||||
}
|
||||
},
|
||||
"tslint-config-prettier": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.15.0.tgz",
|
||||
"integrity": "sha512-06CgrHJxJmNYVgsmeMoa1KXzQRoOdvfkqnJth6XUkNeOz707qxN0WfxfhYwhL5kXHHbYJRby2bqAPKwThlZPhw==",
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.16.0.tgz",
|
||||
"integrity": "sha512-zu6RAcpBtqdvhT6KpBh9kRPYATjOf9BnRi718kNqVKFjEgSE4rFrPprFju1YJrkOa3RbtbWI1ZSuLd2NBX1MDw==",
|
||||
"dev": true
|
||||
},
|
||||
"tsutils": {
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@pushrocks/smartshell",
|
||||
"private": false,
|
||||
"version": "2.0.7",
|
||||
"version": "2.0.11",
|
||||
"description": "shell actions designed as promises",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
@ -28,9 +28,9 @@
|
||||
"@gitzone/tsrun": "^1.1.13",
|
||||
"@gitzone/tstest": "^1.0.15",
|
||||
"@pushrocks/tapbundle": "^3.0.7",
|
||||
"@types/node": "^10.12.0",
|
||||
"@types/node": "^10.12.10",
|
||||
"tslint": "^5.11.0",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
"tslint-config-prettier": "^1.16.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^2.0.5",
|
||||
|
@ -1,4 +1,4 @@
|
||||
export type TExecutor = "sh" | "bash";
|
||||
export type TExecutor = 'sh' | 'bash';
|
||||
|
||||
export interface IShellEnvContructorOptions {
|
||||
executor: TExecutor;
|
||||
@ -19,9 +19,7 @@ export class ShellEnv {
|
||||
|
||||
// add sourcefiles
|
||||
if (optionsArg.sourceFilePaths) {
|
||||
this.sourceFileArray = this.sourceFileArray.concat(
|
||||
optionsArg.sourceFilePaths
|
||||
);
|
||||
this.sourceFileArray = this.sourceFileArray.concat(optionsArg.sourceFilePaths);
|
||||
}
|
||||
|
||||
// add pathDirectories
|
||||
@ -39,9 +37,7 @@ export class ShellEnv {
|
||||
if (process.env.SMARTSHELL_PATH) {
|
||||
commandPath = `${commandPath}:${process.env.SMARTSHELL_PATH}`;
|
||||
}
|
||||
commandResult = `PATH=${
|
||||
commandPath
|
||||
} && ${commandStringArg}`;
|
||||
commandResult = `PATH=${commandPath} && ${commandStringArg}`;
|
||||
return commandResult;
|
||||
}
|
||||
|
||||
@ -63,9 +59,9 @@ export class ShellEnv {
|
||||
}
|
||||
|
||||
createEnvExecString(commandArg): string {
|
||||
let commandResult = ''
|
||||
if (this.executor === "bash") {
|
||||
let sourceString = "";
|
||||
let commandResult = '';
|
||||
if (this.executor === 'bash') {
|
||||
let sourceString = '';
|
||||
for (let sourceFilePath of this.sourceFileArray) {
|
||||
sourceString = sourceString + `source ${sourceFilePath} && `;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export class ShellLog {
|
||||
}
|
||||
return dataArg;
|
||||
})();
|
||||
console.log(dataString);
|
||||
process.stdout.write(dataString);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -21,6 +21,7 @@ export interface IExecResult {
|
||||
export interface IExecResultStreaming {
|
||||
childProcess: cp.ChildProcess;
|
||||
finalPromise: Promise<IExecResult>;
|
||||
kill: () => void;
|
||||
}
|
||||
|
||||
// -- SmartShell --
|
||||
@ -29,7 +30,7 @@ export class Smartshell {
|
||||
|
||||
constructor(optionsArg: IShellEnvContructorOptions) {
|
||||
this.shellEnv = new ShellEnv(optionsArg);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* executes a given command async
|
||||
@ -70,7 +71,11 @@ export class Smartshell {
|
||||
if (streamingArg) {
|
||||
done.resolve({
|
||||
childProcess: execChildProcess,
|
||||
finalPromise: childProcessEnded.promise
|
||||
finalPromise: childProcessEnded.promise,
|
||||
kill: () => {
|
||||
// this notation with the - kills the whole process group
|
||||
process.kill(-execChildProcess.pid);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,14 @@
|
||||
"semicolon": [true, "always"],
|
||||
"no-console": false,
|
||||
"ordered-imports": false,
|
||||
"object-literal-sort-keys": false
|
||||
"object-literal-sort-keys": false,
|
||||
"member-ordering": {
|
||||
"options":{
|
||||
"order": [
|
||||
"static-method"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultSeverity": "warning"
|
||||
}
|
||||
|
Reference in New Issue
Block a user