Skip to content

Commit 6df0a19

Browse files
erickzhaosebastientdsanders11
authored
feat: add support for custom .nuspectemplate file (#491)
* 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]>
1 parent 07a2902 commit 6df0a19

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ export async function createWindowsInstaller(options: SquirrelWindowsOptions): P
130130
metadata.additionalFiles.push({ src: 'vk_swiftshader_icd.json', target: 'lib\\net45' });
131131
}
132132

133-
let templateData = await fs.readFile(path.join(__dirname, '..', 'template.nuspectemplate'), 'utf8');
133+
const templatePath = options.nuspecTemplate || path.join(__dirname, '..', 'template.nuspectemplate');
134+
let templateData = await fs.readFile(templatePath, 'utf8');
134135
if (path.sep === '/') {
135136
templateData = templateData.replace(/\\/g, '/');
136137
for (const f of metadata.additionalFiles) {

src/options.ts

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ export interface SquirrelWindowsOptions {
1313
* Defaults to the installer folder at the project root.
1414
*/
1515
outputDirectory?: string;
16+
/**
17+
* The path to the .nuspectemplate file used by Squirrel.exe.
18+
*
19+
* Defaults to the bundled template.nuspectemplate.
20+
*/
21+
nuspecTemplate?: string;
1622
/**
1723
* The local path to a `.gif` file to display during install.
1824
*/

0 commit comments

Comments
 (0)