fix(core): update

This commit is contained in:
2018-11-26 17:55:15 +01:00
parent 6e7b4dd18e
commit 6a047d6333
5 changed files with 20 additions and 34 deletions

View File

@ -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} && `;
}

View File

@ -30,7 +30,7 @@ export class Smartshell {
constructor(optionsArg: IShellEnvContructorOptions) {
this.shellEnv = new ShellEnv(optionsArg);
};
}
/**
* executes a given command async