diff --git a/Makefile b/Makefile index a1f0c68..7ef3132 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ node_modules: build: node_modules npm run build - chmod +x dist/wtc clean: rm -r dist node_modules diff --git a/README.adoc b/README.adoc index 326a621..d012c0f 100644 --- a/README.adoc +++ b/README.adoc @@ -37,13 +37,7 @@ wtc == Update -The easiest way to update is to first remove the program and then install again - -[,shell] ----- -npm r -g work-time-calculator -npm i -g work-time-calculator ----- +To update, just run the install command again == Rationale diff --git a/bin/wtc b/bin/wtc new file mode 100755 index 0000000..bf01370 --- /dev/null +++ b/bin/wtc @@ -0,0 +1,4 @@ +#!/bin/sh + +DIR="$(dirname "$(readlink -f "$0")")" +node "$DIR/../dist/wtc.js" "$@" diff --git a/package.json b/package.json index 0171f14..a7461f9 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "main": "src/main.ts", "type": "module", "bin": { - "wtc": "dist/wtc" + "wtc": "bin/wtc" }, "scripts": { "build": "rollup -c" @@ -34,7 +34,6 @@ "@typescript-eslint/eslint-plugin": "^6.10.0", "eslint-config-prettier": "^9.0.0", "rollup": "^4.5.1", - "rollup-plugin-add-shebang": "^0.3.1", "tslib": "^2.6.2" }, "dependencies": { diff --git a/rollup.config.js b/rollup.config.js index 0aef700..c109771 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,15 +1,14 @@ import typescript from '@rollup/plugin-typescript'; import terser from '@rollup/plugin-terser'; -import shebang from 'rollup-plugin-add-shebang'; /** @type {import('rollup').RollupOptions} */ const config = { input: 'src/main.ts', output: { format: 'esm', - file: 'dist/wtc', + file: 'dist/wtc.js', }, - plugins: [typescript(), terser(), shebang({ include: 'dist/wtc' })], + plugins: [typescript(), terser()], external: [ '@iarna/toml', 'chalk',