Skip to content

Commit

Permalink
iiii
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoishin committed Dec 26, 2024
1 parent e1bcb28 commit 35f6f48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/commands/uninstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import path from "node:path";
import chalk from "chalk";
import { Command } from "commander";
import inquirer from "inquirer";
import rimraf from "rimraf";

import util from "../lib/util.js";

Expand Down Expand Up @@ -60,7 +59,7 @@ function deleteBundle(name: string, path: string) {

process.stdout.write("Uninstalling " + chalk.magenta(name) + "... ");
try {
rimraf.sync(path);
fs.rmSync(path, { recursive: true, force: true });
} catch (e: any) {
/* istanbul ignore next */
process.stdout.write(chalk.red("failed!") + os.EOL);
Expand Down
11 changes: 8 additions & 3 deletions test/commands/install.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import fs from "node:fs";

import { Command } from "commander";
import rimraf from "rimraf";
import semver from "semver";
import { beforeEach, expect, it, vi } from "vitest";

Expand Down Expand Up @@ -43,8 +42,14 @@ it("should install a version that satisfies a provided semver range", async () =
});

it("should install bower & npm dependencies when run with no arguments in a bundle directory", async () => {
rimraf.sync("./bundles/lfg-streamtip/node_modules");
rimraf.sync("./bundles/lfg-streamtip/bower_components");
fs.rmSync("./bundles/lfg-streamtip/node_modules", {
recursive: true,
force: true,
});
fs.rmSync("./bundles/lfg-streamtip/bower_components", {
recursive: true,
force: true,
});

process.chdir("./bundles/lfg-streamtip");
await program.runWith("install");
Expand Down

0 comments on commit 35f6f48

Please sign in to comment.