This commit is contained in:
Philipp Kunz 2017-05-15 16:35:16 +02:00
parent e541159019
commit d1e7448b40
5 changed files with 14 additions and 18 deletions

View File

@ -9,7 +9,7 @@ export declare let yarnAvailable: plugins.q.Deferred<boolean>;
* @param commandArg - The command to execute * @param commandArg - The command to execute
* @param retryArg - The retryArg: 0 to any positive number will retry, -1 will always succeed, -2 will return undefined * @param retryArg - The retryArg: 0 to any positive number will retry, -1 will always succeed, -2 will return undefined
*/ */
export declare let bash: (commandArg: string, retryArg?: number, bareArg?: boolean) => Promise<string>; export declare let bash: (commandArg: string, retryArg?: number) => Promise<string>;
/** /**
* bashNoError allows executing stuff without throwing an error * bashNoError allows executing stuff without throwing an error
*/ */

13
dist/npmci.bash.js vendored
View File

@ -40,7 +40,6 @@ let checkToolsAvailable = () => __awaiter(this, void 0, void 0, function* () {
else { else {
exports.nvmAvailable.resolve(false); exports.nvmAvailable.resolve(false);
} }
;
// check for yarn // check for yarn
yield plugins.smartshell.which('yarn').then(() => __awaiter(this, void 0, void 0, function* () { yield plugins.smartshell.which('yarn').then(() => __awaiter(this, void 0, void 0, function* () {
yield plugins.smartshell.exec(`yarn config set cache-folder ${plugins.path.join(paths.cwd, '.yarn')}`); yield plugins.smartshell.exec(`yarn config set cache-folder ${plugins.path.join(paths.cwd, '.yarn')}`);
@ -58,7 +57,7 @@ checkToolsAvailable();
* @param commandArg - The command to execute * @param commandArg - The command to execute
* @param retryArg - The retryArg: 0 to any positive number will retry, -1 will always succeed, -2 will return undefined * @param retryArg - The retryArg: 0 to any positive number will retry, -1 will always succeed, -2 will return undefined
*/ */
exports.bash = (commandArg, retryArg = 2, bareArg = false) => __awaiter(this, void 0, void 0, function* () { exports.bash = (commandArg, retryArg = 2) => __awaiter(this, void 0, void 0, function* () {
yield exports.nvmAvailable.promise; // make sure nvm check has run yield exports.nvmAvailable.promise; // make sure nvm check has run
let execResult; let execResult;
// determine if we fail // determine if we fail
@ -69,12 +68,10 @@ exports.bash = (commandArg, retryArg = 2, bareArg = false) => __awaiter(this, vo
} }
if (!process.env.NPMTS_TEST) { if (!process.env.NPMTS_TEST) {
for (let i = 0; i <= retryArg; i++) { for (let i = 0; i <= retryArg; i++) {
if (!bareArg) { if (process.env.DEBUG_NPMCI === 'true') {
execResult = yield npmciSmartshell.exec(commandArg); console.log(commandArg);
}
else {
execResult = yield npmciSmartshell.exec(commandArg);
} }
execResult = yield npmciSmartshell.exec(commandArg);
// determine how bash reacts to error and success // determine how bash reacts to error and success
if (execResult.exitCode !== 0 && i === retryArg) { if (execResult.exitCode !== 0 && i === retryArg) {
if (failOnError) { if (failOnError) {
@ -107,4 +104,4 @@ exports.bash = (commandArg, retryArg = 2, bareArg = false) => __awaiter(this, vo
exports.bashNoError = (commandArg) => __awaiter(this, void 0, void 0, function* () { exports.bashNoError = (commandArg) => __awaiter(this, void 0, void 0, function* () {
return yield exports.bash(commandArg, -1); return yield exports.bash(commandArg, -1);
}); });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuYmFzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLmJhc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLDJDQUEwQztBQUMxQyx1Q0FBc0M7QUFFdEMsaUNBQWdDO0FBRWhDOztHQUVHO0FBQ1EsUUFBQSxZQUFZLEdBQUcsTUFBTSxDQUFDLEtBQUssRUFBVyxDQUFBO0FBQ3RDLFFBQUEsYUFBYSxHQUFHLE1BQU0sQ0FBQyxLQUFLLEVBQVcsQ0FBQTtBQUNsRDs7R0FFRztBQUNILElBQUksZUFBZSxHQUFHLElBQUksT0FBTyxDQUFDLFVBQVUsQ0FBQyxVQUFVLENBQUM7SUFDdEQsUUFBUSxFQUFFLE1BQU07SUFDaEIsZUFBZSxFQUFFLEVBQUU7Q0FDcEIsQ0FBQyxDQUFBO0FBRUY7O0dBRUc7QUF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Q0FBQyxDQUFBO2dCQUM1RixPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxRQUFRLEdBQUcsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsUUFBUSxFQUFFLEdBQUcsTUFBTSxHQUFHLFFBQVEsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFBO1lBQ3RGLENBQUM7UUFDSCxDQUFDO0lBQ0gsQ0FBQztJQUFDLElBQUksQ0FBQyxDQUFDO1FBQ04sT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsc0JBQXNCLEdBQUcsVUFBVSxDQUFDLENBQUE7UUFDMUQsTUFBTSxPQUFPLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsQ0FBQTtRQUN0QyxVQUFVLEdBQUc7WUFDWCxRQUFRLEVBQUUsQ0FBQztZQUNYLE1BQU0sRUFBRSxZQUFZO1NBQ3JCLENBQUE7SUFDSCxDQUFDO0lBQ0QsTUFBTSxDQUFDLFVBQVUsQ0FBQyxNQUFNLENBQUE7QUFDMUIsQ0FBQyxDQUFBLENBQUE7QUFFRDs7R0FFRztBQUNRLFFBQUEsV0FBVyxHQUFHLENBQU8sVUFBa0I7SUFDaEQsTUFBTSxDQUFDLE1BQU0sWUFBSSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFBO0FBQ25DLENBQUMsQ0FBQSxDQUFBIn0=

File diff suppressed because one or more lines are too long

View File

@ -34,7 +34,7 @@ let checkToolsAvailable = async () => {
nvmAvailable.resolve(true) nvmAvailable.resolve(true)
} else { } else {
nvmAvailable.resolve(false) nvmAvailable.resolve(false)
}; }
// check for yarn // check for yarn
await plugins.smartshell.which('yarn').then( await plugins.smartshell.which('yarn').then(
@ -56,7 +56,7 @@ checkToolsAvailable()
* @param commandArg - The command to execute * @param commandArg - The command to execute
* @param retryArg - The retryArg: 0 to any positive number will retry, -1 will always succeed, -2 will return undefined * @param retryArg - The retryArg: 0 to any positive number will retry, -1 will always succeed, -2 will return undefined
*/ */
export let bash = async (commandArg: string, retryArg: number = 2, bareArg: boolean = false): Promise<string> => { export let bash = async (commandArg: string, retryArg: number = 2): Promise<string> => {
await nvmAvailable.promise // make sure nvm check has run await nvmAvailable.promise // make sure nvm check has run
let execResult: plugins.smartshell.IExecResult let execResult: plugins.smartshell.IExecResult
@ -69,11 +69,10 @@ export let bash = async (commandArg: string, retryArg: number = 2, bareArg: bool
if (!process.env.NPMTS_TEST) { // NPMTS_TEST is used during testing if (!process.env.NPMTS_TEST) { // NPMTS_TEST is used during testing
for (let i = 0; i <= retryArg; i++) { for (let i = 0; i <= retryArg; i++) {
if (!bareArg) { if (process.env.DEBUG_NPMCI === 'true') {
execResult = await npmciSmartshell.exec(commandArg) console.log(commandArg)
} else {
execResult = await npmciSmartshell.exec(commandArg)
} }
execResult = await npmciSmartshell.exec(commandArg)
// determine how bash reacts to error and success // determine how bash reacts to error and success
if (execResult.exitCode !== 0 && i === retryArg) { // something went wrong and retries are exhausted if (execResult.exitCode !== 0 && i === retryArg) { // something went wrong and retries are exhausted

View File

@ -28,7 +28,7 @@ export let readDockerfiles = async (): Promise<Dockerfile[]> => {
console.log(fileTree) console.log(fileTree)
for (let dockerfilePath of fileTree) { for (let dockerfilePath of fileTree) {
let myDockerfile = new Dockerfile({ let myDockerfile = new Dockerfile({
filePath: plugins.path.join(paths.cwd, dockerfilePath), filePath: dockerfilePath,
read: true read: true
}) })
readDockerfilesArray.push(myDockerfile) readDockerfilesArray.push(myDockerfile)