Skip to content

Commit

Permalink
fix: add empty yarn.lock to new projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Kabir-Ivan committed Jul 25, 2024
1 parent 4603173 commit 2035c72
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/package.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from "fs/promises";
import ora from "ora";
import path from "path";
import { exec } from "child_process";
Expand Down Expand Up @@ -91,6 +92,11 @@ export const installPackages = async (
const spinner = ora("Installing packages (this may take a while)").start();

const pluginsPackages = pluginsToInstall.map(packageNameFromPlugin).join(" ");

if (packageManager === "yarn") {
await fs.writeFile(path.join(dirPath, "yarn.lock"), "");
}

return new Promise<string>((resolve, reject) => {
exec(
PMS[packageManager].withRegistry(
Expand All @@ -104,7 +110,7 @@ export const installPackages = async (
(error, stdout, stderr) => {
if (error) {
spinner.fail("An error occured during installation");
reject(stderr);
reject(`${stdout}\n${stderr}`);
} else {
spinner.succeed(
`Testplane and plugins have been installed successfully at ${Colors.fillGreen(dirPath)}`,
Expand Down

0 comments on commit 2035c72

Please sign in to comment.