Fix running on older nodejs versions
The shebang does not work without extension
This commit is contained in:
parent
536aaa01b0
commit
6bbfd25745
1
Makefile
1
Makefile
|
@ -13,7 +13,6 @@ node_modules:
|
|||
|
||||
build: node_modules
|
||||
npm run build
|
||||
chmod +x dist/wtc
|
||||
|
||||
clean:
|
||||
rm -r dist node_modules
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
4
bin/wtc
Executable file
4
bin/wtc
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
DIR="$(dirname "$(readlink -f "$0")")"
|
||||
node "$DIR/../dist/wtc.js" "$@"
|
|
@ -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": {
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue