diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aa71cf..cdfd6dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## [0.0.3] - 2023-08-02 + +### Fixed + +- `stop` command arg parse issue. ([#38](https://github.com/casper-network/casper-node-launcher-js/pull/38)) + ## [0.0.2] - 2023-08-01 ### Changed @@ -29,5 +35,6 @@ Initial version of `casper-node-launcher-js`. - Started to use CHANGELOG. -[0.0.2]: https://github.com/casper-network/casper-node-launcher-js/compare/0.0.2...main +[0.0.3]: https://github.com/casper-network/casper-node-launcher-js/compare/0.0.3...main +[0.0.2]: https://github.com/casper-network/casper-node-launcher-js/compare/0.0.2...0.0.2 [0.0.1]: https://github.com/casper-network/casper-node-launcher-js/compare/0.0.1...0.0.2 diff --git a/package.json b/package.json index 9068755..c0aa6a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "casper-node-launcher-js", - "version": "0.0.2", + "version": "0.0.3", "description": "CLI makes easy to run single casper node for test purpose", "author": "Ryo Kanazawa ", "bin": { diff --git a/src/commands/stop.ts b/src/commands/stop.ts index 6ca6144..7b74559 100644 --- a/src/commands/stop.ts +++ b/src/commands/stop.ts @@ -10,10 +10,13 @@ export default class Stop extends Command { static description = "Stop running node in background."; async run(): Promise { - 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", });