Skip to content

Commit 7d92989

Browse files
committed
Fix -v
1 parent f25b39c commit 7d92989

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.github/workflows/ci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ jobs:
1515
node-version: [18.x, 20.x]
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v1
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: ${{ matrix.node-version }}
2323
- run: npm install
2424
- run: npm test
2525
env:
2626
CI: true
27-
27+
- name: Try CLI
28+
run: node bin/cli.mjs -v
2829
- name: Coveralls Parallel
29-
uses: coverallsapp/github-action@master
30+
uses: coverallsapp/github-action@v2
3031
with:
3132
github-token: ${{ secrets.github_token }}
3233
flag-name: run-${{ matrix.node-version }}
@@ -37,7 +38,7 @@ jobs:
3738
runs-on: ubuntu-latest
3839
steps:
3940
- name: Coveralls Finished
40-
uses: coverallsapp/github-action@master
41+
uses: coverallsapp/github-action@v2
4142
with:
4243
github-token: ${{ secrets.github_token }}
4344
parallel-finished: true

bin/cli.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ async function main() {
5656
}
5757

5858
if (process.argv.includes('--version') || process.argv.includes('-v')) {
59-
console.log('v' + require('../package.json').version)
59+
const json = fs.readFileSync(path.resolve(__dirname, '../package.json'), { encoding: 'utf-8' })
60+
const { version } = JSON.parse(json)
61+
console.log(`v${version}`)
6062
return
6163
}
6264

0 commit comments

Comments
 (0)