Skip to content

Commit a3a3d28

Browse files
committed
fix: xpiname undefined
1 parent 24c6fd9 commit a3a3d28

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function resolveConfig(config: Config): Context {
5555
const ctx: Context = {
5656
...config,
5757
pkgUser: pkg,
58+
xpiName: dash(config.name),
5859
version: pkg.version,
5960
hooks: createHooks(),
6061
templateDate: data,

src/lib/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ export abstract class Base {
4040
return this.ctx.updateURL;
4141
}
4242
get xpiName() {
43-
return this.ctx.build.define.xpiName;
43+
return this.ctx.xpiName;
4444
}
4545
}

src/lib/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export default class Build extends Base {
233233
max = manifest.applications?.zotero?.strict_max_version;
234234

235235
const updateHash = generateHashSync(
236-
path.join(this.dist, `${this.ctx.templateDate.xpiName}.xpi`),
236+
path.join(this.dist, `${this.xpiName}.xpi`),
237237
"sha512",
238238
);
239239

@@ -278,7 +278,7 @@ export default class Build extends Base {
278278
await webext.cmd.build({
279279
sourceDir: `${this.dist}/addon`,
280280
artifactsDir: this.dist,
281-
filename: `${this.ctx.templateDate.xpiName}.xpi`,
281+
filename: `${this.xpiName}.xpi`,
282282
overwriteDest: true,
283283
});
284284
}

src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface UserConfig extends RecursivePartial<Config> {
2121

2222
interface Context extends Config {
2323
pkgUser: any;
24+
xpiName: string;
2425
version: string;
2526
hooks: Hookable<Hooks>;
2627
templateDate: { [placeholder: string]: string };

0 commit comments

Comments
 (0)