Skip to content

Commit 885db02

Browse files
committed
Fix the floating promises in this project.
1 parent d7b9607 commit 885db02

6 files changed

Lines changed: 24 additions & 20 deletions

File tree

apps/api-documenter/src/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ console.log(os.EOL + colors.bold(`api-documenter ${myPackageVersion} `
1515

1616
const parser: ApiDocumenterCommandLine = new ApiDocumenterCommandLine();
1717

18-
parser.execute();
18+
parser.execute().catch(console.error);

apps/rush-lib/src/api/Rush.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class Rush {
3636
}
3737

3838
const parser: RushCommandLineParser = new RushCommandLineParser();
39-
parser.execute();
39+
parser.execute().catch(console.error);
4040
}
4141

4242
/**

apps/rush-lib/src/cli/actions/ChangeAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ export class ChangeAction extends BaseRushAction {
451451
console.log(`Not overwriting ${filePath}...`);
452452
return Promise.resolve();
453453
}
454-
});
454+
}).catch(console.error);
455455
}
456456

457457
this._writeFile(filePath, output);

core-build/gulp-core-build/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export function watch(watchMatch: string | string[], taskExecutable: IExecutable
268268
setWatchMode();
269269
buildConfig.gulp.watch(watchMatch, _runWatch);
270270

271-
_runWatch();
271+
_runWatch().catch(console.error);
272272
});
273273
}
274274
};

core-build/gulp-core-build/src/tasks/BuildReceiptTask.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,25 @@ export class CheckBuildReceiptTask extends GulpTask<IBuildReceiptTask> {
3535
gulp: typeof Gulp,
3636
completeCallback: (error?: string | Error) => void
3737
): Promise<Object> | NodeJS.ReadWriteStream | void {
38-
_getLocalHashes().then(localHashes => {
39-
_lastLocalHashes = localHashes;
40-
_readPackageHashes(path.join(process.cwd(), this.buildConfig.packageFolder, 'build.json')).then(packageHashes => {
41-
if (packageHashes) {
42-
if (_areObjectsEqual(localHashes, packageHashes)) {
43-
this.buildConfig.isRedundantBuild = true;
44-
this.log('Build is redundant. Skipping steps.');
45-
} else {
46-
_areObjectsEqual(localHashes, packageHashes);
47-
this.log('Build has new content, continuing execution.');
48-
}
49-
}
50-
completeCallback();
51-
});
52-
});
38+
_getLocalHashes()
39+
.then(localHashes => {
40+
_lastLocalHashes = localHashes;
41+
_readPackageHashes(path.join(process.cwd(), this.buildConfig.packageFolder, 'build.json'))
42+
.then(packageHashes => {
43+
if (packageHashes) {
44+
if (_areObjectsEqual(localHashes, packageHashes)) {
45+
this.buildConfig.isRedundantBuild = true;
46+
this.log('Build is redundant. Skipping steps.');
47+
} else {
48+
_areObjectsEqual(localHashes, packageHashes);
49+
this.log('Build has new content, continuing execution.');
50+
}
51+
}
52+
completeCallback();
53+
})
54+
.catch(console.error);
55+
})
56+
.catch(console.error);
5357
}
5458
}
5559

stack/rush-stack/src/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ console.log(os.EOL + colors.bold(`rush-stack ${currentPackageVersion} `
1616

1717
const parser: RushStackCommandLine = new RushStackCommandLine();
1818

19-
parser.execute();
19+
parser.execute().catch(console.error);

0 commit comments

Comments
 (0)