Skip to content

Commit

Permalink
feat: add support for custom .nuspectemplate file (#491)
Browse files Browse the repository at this point in the history
* Added support for custom .nuspectemplate file.

* Update src/index.ts

---------

Co-authored-by: Sébastien Taylor <[email protected]>
Co-authored-by: David Sanders <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2023
1 parent 07a2902 commit 6df0a19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ export async function createWindowsInstaller(options: SquirrelWindowsOptions): P
metadata.additionalFiles.push({ src: 'vk_swiftshader_icd.json', target: 'lib\\net45' });
}

let templateData = await fs.readFile(path.join(__dirname, '..', 'template.nuspectemplate'), 'utf8');
const templatePath = options.nuspecTemplate || path.join(__dirname, '..', 'template.nuspectemplate');
let templateData = await fs.readFile(templatePath, 'utf8');
if (path.sep === '/') {
templateData = templateData.replace(/\\/g, '/');
for (const f of metadata.additionalFiles) {
Expand Down
6 changes: 6 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export interface SquirrelWindowsOptions {
* Defaults to the installer folder at the project root.
*/
outputDirectory?: string;
/**
* The path to the .nuspectemplate file used by Squirrel.exe.
*
* Defaults to the bundled template.nuspectemplate.
*/
nuspecTemplate?: string;
/**
* The local path to a `.gif` file to display during install.
*/
Expand Down

0 comments on commit 6df0a19

Please sign in to comment.