Move resolution of package.json path to inside deployPackage
This commit is contained in:
@@ -47,12 +47,10 @@ async function copyPackage(
|
||||
);
|
||||
}
|
||||
|
||||
export async function deployPackage(
|
||||
packageJsonPath: string,
|
||||
): Promise<DeployedPackage> {
|
||||
export async function deployPackage(): Promise<DeployedPackage> {
|
||||
try {
|
||||
const packageJson: typeof packageJsonType = JSON.parse(
|
||||
await readFile(packageJsonPath, "utf8"),
|
||||
await readFile(resolve(__dirname, "../package.json"), "utf8"),
|
||||
);
|
||||
|
||||
const distDir = join(__dirname, "../../../dist");
|
||||
|
||||
@@ -3,9 +3,7 @@ import { deployPackage } from "./deploy";
|
||||
import { spawn } from "child-process-promise";
|
||||
|
||||
export async function packageExtension(): Promise<void> {
|
||||
const deployedPackage = await deployPackage(
|
||||
resolve(__dirname, "../package.json"),
|
||||
);
|
||||
const deployedPackage = await deployPackage();
|
||||
console.log(
|
||||
`Packaging extension '${deployedPackage.name}@${deployedPackage.version}'...`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user