diff --git a/commands/help.js b/commands/help.js index 71fcad9..9fbd132 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,6 +1,9 @@ import "colors"; import * as fs from "node:fs"; -const packageJson = JSON.parse(fs.readFileSync('package.json')) +import appRootPath from "app-root-path"; +import * as path from "node:path"; + +const packageJson = JSON.parse(fs.readFileSync(path.join(appRootPath.path, 'package.json'))) export default () => { console.log(`⚓ whcli: Webhook.site CLI ${packageJson.version} diff --git a/package-lock.json b/package-lock.json index 725a686..3a5beba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,15 @@ { "name": "@webhooksite/cli", - "version": "0.1.10", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@webhooksite/cli", - "version": "0.1.10", + "version": "0.2.0", "license": "MIT", "dependencies": { + "app-root-path": "^3.1.0", "colors": "^1.4.0", "laravel-echo": "^1.16.1", "minimist": "^1.2.8", @@ -19,6 +20,9 @@ }, "bin": { "whcli": "index.js" + }, + "engines": { + "node": ">=16.0.0" } }, "node_modules/abort-controller": { @@ -37,6 +41,14 @@ "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", "integrity": "sha512-QbJ0NTQ/I9DI3uSJA4cbexiwQeRAfjPScqIbSjUDd9TOrcg6pTkdgziesOqxBMBzit8vFCTwrP27t13vFOORRA==" }, + "node_modules/app-root-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/arraybuffer.slice": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", diff --git a/package.json b/package.json index c299e71..42265b3 100644 --- a/package.json +++ b/package.json @@ -2,15 +2,16 @@ "name": "@webhooksite/cli", "description": "Client for Webhook.site", "repository": "webhooksite/cli", - "version": "0.2.0", + "version": "0.2.1", "type": "module", "publishConfig": { "registry": "https://registry.npmjs.org/" }, - "engines" : { - "node" : ">=16.0.0" + "engines": { + "node": ">=16.0.0" }, "dependencies": { + "app-root-path": "^3.1.0", "colors": "^1.4.0", "laravel-echo": "^1.16.1", "minimist": "^1.2.8", @@ -25,6 +26,6 @@ }, "scripts": { "start": "node index.js", - "build": "export VERSION=$(jq -r '.version' package.json) ; git tag $VERSION ; docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64,linux/arm64 --tag webhooksite/cli:latest --tag webhooksite/cli:$VERSION --push . ; npm publish" + "build": "export VERSION=$(jq -r '.version' package.json) ; git tag $VERSION ; git push origin refs/tags/$VERSION ; docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64,linux/arm64 --tag webhooksite/cli:latest --tag webhooksite/cli:$VERSION --push . ; npm publish" } }