Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Only update .modules if existing
Browse files Browse the repository at this point in the history
  • Loading branch information
mircearoata committed Apr 13, 2021
1 parent 1c62c04 commit 648c4ff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/satisfactoryInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ export class SatisfactoryInstall {
return;
}
const modulesPath = path.join(mod.path, 'Binaries', 'Win64', 'UE4-Win64-Shipping.modules');
const modules = JSON.parse(fs.readFileSync(modulesPath, { encoding: 'utf8' }));
modules.BuildId = this.version;
fs.writeFileSync(modulesPath, JSON.stringify(modules, null, 4));
if (fs.existsSync(modulesPath)) {
const modules = JSON.parse(fs.readFileSync(modulesPath, { encoding: 'utf8' }));
modules.BuildId = this.version;
fs.writeFileSync(modulesPath, JSON.stringify(modules, null, 4));
}
});
}
}
Expand Down

0 comments on commit 648c4ff

Please sign in to comment.