Skip to content

Commit

Permalink
fix: stop commande parse arg issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gyroflaw committed Aug 2, 2023
1 parent bb396cd commit 1f47f66
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/commands/stop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ export default class Stop extends Command {
static description = "Stop running node in background.";

async run(): Promise<void> {
const { args } = await this.parse(Stop);
const workDir = path.resolve(__dirname, "../..", WORK_DIR);
const pidFilePath = path.resolve(workDir, ".pid");

if (!fs.existsSync(pidFilePath)) {
this.error("No running node found", { exit: -1 });
}

const workDir = path.resolve(__dirname, "../..", WORK_DIR, args.branch);
const pidFilePath = path.resolve(workDir, "../.pid");
const pid = fs.readFileSync(pidFilePath, {
encoding: "utf8",
});
Expand Down

0 comments on commit 1f47f66

Please sign in to comment.