Skip to content
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

Prevent overwriting the Program._manifest if already set on startup #1027

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
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
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