Skip to content

Commit

Permalink
Fix zip archive version
Browse files Browse the repository at this point in the history
  • Loading branch information
irshadahmad21 committed Jan 23, 2024
1 parent c815637 commit e870b53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/wpdev/src/commands/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default class Bundle extends WithProjects<typeof Bundle> {

const projectInfo = project.wpdev;

const bundle = await getProjectBundleConfig(project);
const bundle = await getProjectBundleConfig(project, { version });

const outDir = this.getOutputDir(project);

Expand Down
7 changes: 4 additions & 3 deletions tools/wpdev/src/utils/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type ProjectConfig = {
getBundleConfig: (
options: Required<ProjectInfoInput> & {
project: WPProject;
version?: string;
version: string;
},
) => BundleConfigInput;
};
Expand Down Expand Up @@ -149,12 +149,13 @@ export async function getProjectInfo(
}

type ProjectBundleConfigOptions = {
version: string;
globalConfig?: string;
};

export async function getProjectBundleConfig(
project: WPProject,
{ globalConfig }: ProjectBundleConfigOptions = {},
{ globalConfig, version }: ProjectBundleConfigOptions,
) {
const configPath = path.join(project.dir, PROJECT_CONFIG_FILE_NAME);
const configPathRel = path.relative(process.cwd(), configPath);
Expand All @@ -177,7 +178,7 @@ export async function getProjectBundleConfig(
}

const bundleResult = bundleSchema.safeParse(
getBundleConfig({ project, ...project.wpdev }),
getBundleConfig({ project, ...project.wpdev, version }),
);

if (!bundleResult.success) {
Expand Down

0 comments on commit e870b53

Please sign in to comment.