From 6878bc0911b809f965f81aa3cfcc8e5499945c33 Mon Sep 17 00:00:00 2001 From: bluwy Date: Fri, 25 Aug 2023 00:14:56 +0800 Subject: [PATCH] fix: resolve pkgDir to absolute path --- src/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index f9cc985..c085736 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -20,7 +20,7 @@ export function getPackageInfo( pkgName: string, getPkgDir: ((pkg: string) => string) | undefined = (pkg) => `packages/${pkg}`, ) { - const pkgDir = getPkgDir(pkgName); + const pkgDir = path.resolve(getPkgDir(pkgName)); const pkgPath = path.resolve(pkgDir, "package.json"); const pkg = JSON.parse(readFileSync(pkgPath, "utf-8")) as { name: string; @@ -135,7 +135,7 @@ export function updateVersion(pkgPath: string, version: string): void { } export async function publishPackage( - pkdDir: string, + pkgDir: string, tag?: string, provenance?: boolean, ): Promise { @@ -147,7 +147,7 @@ export async function publishPackage( publicArgs.push(`--provenance`); } await runIfNotDry("npm", publicArgs, { - cwd: pkdDir, + cwd: pkgDir, }); }