diff --git a/README.md b/README.md index 8128119..5725be6 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ This way even entityIds like environmentIds or testCaseIds will be autocompleted # octomind -Octomind cli tool. Version: 4.3.0. Additional documentation see https://octomind.dev/docs/api-reference/ +Octomind cli tool. Version: 4.3.1. Additional documentation see https://octomind.dev/docs/api-reference/ **Usage:** `octomind [options] [command]` diff --git a/package.json b/package.json index e5a2f56..12b46dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@octomind/octomind", - "version": "4.3.0", + "version": "4.3.1", "description": "a command line client for octomind apis", "main": "./dist/index.js", "packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48", diff --git a/src/tools/update.ts b/src/tools/update.ts index 2091739..3aff6dd 100644 --- a/src/tools/update.ts +++ b/src/tools/update.ts @@ -7,7 +7,7 @@ import which from "which"; export const update = async (): Promise => { const pathToRoot = path.posix.normalize( - path.join(homedir(), "/.local/packages"), + path.join(homedir(), ".local", "packages"), ); const pathToPackageJson = path.join(pathToRoot, "package.json"); @@ -25,15 +25,22 @@ export const update = async (): Promise => { process.exit(1); } - console.log(`updating package.json at ${pathToPackageJson}`); + const oldVersion = child_process.execSync("npm list @octomind/octomind", { + cwd: pathToRoot, + stdio: ["ignore", "pipe", "ignore"], + }); - const result = child_process.execSync( - "npm install @octomind/octomind@latest", - { - cwd: path.dirname(pathToRoot), - }, - ); + console.log(`version before update: ${oldVersion}`); + + child_process.execSync("npm install @octomind/octomind@latest", { + cwd: pathToRoot, + stdio: "ignore", + }); + + const newVersion = child_process.execSync("npm list @octomind/octomind", { + cwd: pathToRoot, + stdio: ["ignore", "pipe", "ignore"], + }); - console.log(`${result}`); - console.log("\nāœ” update complete"); + console.log(`āœ” update complete: ${newVersion}`); }; diff --git a/tests/tools/update.spec.ts b/tests/tools/update.spec.ts index e953ef8..12d934a 100644 --- a/tests/tools/update.spec.ts +++ b/tests/tools/update.spec.ts @@ -35,7 +35,7 @@ describe("update", () => { expect(child_process.execSync).toHaveBeenCalledWith( "npm install @octomind/octomind@latest", - { cwd: path.dirname(mockPathToRoot) }, + { cwd: mockPathToRoot, stdio: "ignore" }, ); });