Skip to content

Commit f41b675

Browse files
committed
Using package's version for CLI version, exiting with non-zero code on failure.
1 parent 0d0a2dc commit f41b675

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/web/bin/powersync.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ const { Command } = require('commander');
44
const program = new Command();
55
const path = require('path');
66
const fsPromise = require('fs/promises');
7-
7+
const { version } = require('../package.json');
8+
89
program
910
.name('powersync-web')
1011
.description('CLI for PowerSync Web SDK utilities')
11-
.version('0.0.1');
12+
.version(version);
1213

1314
program
1415
.command('copy-assets')
@@ -37,5 +38,6 @@ async function copyDirectory(source, destination) {
3738
console.log(`Assets copied from ${source} to ${destination}`);
3839
} catch (err) {
3940
console.error(`Error copying assets: ${err.message}`);
41+
process.exit(1);
4042
}
4143
}

0 commit comments

Comments
 (0)