Skip to content

Commit

Permalink
Prevent overwriting the Program._manifest if already set on startup (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron authored Jan 24, 2024
1 parent 1b948c5 commit f773d92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1385,8 +1385,13 @@ export class Program {
/**
* Try to find and load the manifest into memory
* @param manifestFileObj A pointer to a potential manifest file object found during loading
* @param replaceIfAlreadyLoaded should we overwrite the internal `_manifest` if it already exists
*/
public loadManifest(manifestFileObj?: FileObj) {
public loadManifest(manifestFileObj?: FileObj, replaceIfAlreadyLoaded = true) {
//if we already have a manifest instance, and should not replace...then don't replace
if (!replaceIfAlreadyLoaded && this._manifest) {
return;
}
let manifestPath = manifestFileObj
? manifestFileObj.src
: path.join(this.options.rootDir, 'manifest');
Expand Down
2 changes: 1 addition & 1 deletion src/ProgramBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ export class ProgramBuilder {
}

if (manifestFile) {
this.program!.loadManifest(manifestFile);
this.program!.loadManifest(manifestFile, false);
}

const loadFile = async (fileObj) => {
Expand Down

0 comments on commit f773d92

Please sign in to comment.