Skip to content

Commit

Permalink
fix: xpiname undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
northword committed Mar 31, 2024
1 parent 24c6fd9 commit a3a3d28
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function resolveConfig(config: Config): Context {
const ctx: Context = {
...config,
pkgUser: pkg,
xpiName: dash(config.name),
version: pkg.version,
hooks: createHooks(),
templateDate: data,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ export abstract class Base {
return this.ctx.updateURL;
}
get xpiName() {
return this.ctx.build.define.xpiName;
return this.ctx.xpiName;
}
}
4 changes: 2 additions & 2 deletions src/lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export default class Build extends Base {
max = manifest.applications?.zotero?.strict_max_version;

const updateHash = generateHashSync(
path.join(this.dist, `${this.ctx.templateDate.xpiName}.xpi`),
path.join(this.dist, `${this.xpiName}.xpi`),
"sha512",
);

Expand Down Expand Up @@ -278,7 +278,7 @@ export default class Build extends Base {
await webext.cmd.build({
sourceDir: `${this.dist}/addon`,
artifactsDir: this.dist,
filename: `${this.ctx.templateDate.xpiName}.xpi`,
filename: `${this.xpiName}.xpi`,
overwriteDest: true,
});
}
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface UserConfig extends RecursivePartial<Config> {

interface Context extends Config {
pkgUser: any;
xpiName: string;
version: string;
hooks: Hookable<Hooks>;
templateDate: { [placeholder: string]: string };
Expand Down

0 comments on commit a3a3d28

Please sign in to comment.