Skip to content

Print warning when more than one package is produced from build #3489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,13 @@ export class PlatformService extends EventEmitter implements IPlatformService {

private getLatestApplicationPackage(buildOutputPath: string, validBuildOutputData: IValidBuildOutputData): IApplicationPackage {
let packages = this.getApplicationPackages(buildOutputPath, validBuildOutputData);
const packageExtName = path.extname(validBuildOutputData.packageNames[0]);
if (packages.length === 0) {
const packageExtName = path.extname(validBuildOutputData.packageNames[0]);
this.$errors.fail("No %s found in %s directory", packageExtName, buildOutputPath);
this.$errors.fail(`No ${packageExtName} found in ${buildOutputPath} directory.`);
}

if (packages.length > 1) {
this.$logger.warn(`More than one ${packageExtName} found in ${buildOutputPath} directory. Using the last one produced from build.`);
}

packages = _.sortBy(packages, pkg => pkg.time).reverse(); // We need to reverse because sortBy always sorts in ascending order
Expand Down