@adrive/cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,7 +15,13 @@ import { cmdRunLog } from './commands/run-log.js';
|
|
|
15
15
|
import { cmdBilling } from './commands/billing.js';
|
|
16
16
|
import { cmdPlan } from './commands/plan.js';
|
|
17
17
|
import { cmdPrivacy } from './commands/privacy.js';
|
|
18
|
-
|
|
18
|
+
// Read from the bundled package.json so we never drift again.
|
|
19
|
+
import { readFileSync } from 'node:fs';
|
|
20
|
+
import { fileURLToPath } from 'node:url';
|
|
21
|
+
import { dirname as pathDirname, join as pathJoin } from 'node:path';
|
|
22
|
+
const __dirname = pathDirname(fileURLToPath(import.meta.url));
|
|
23
|
+
const pkg = JSON.parse(readFileSync(pathJoin(__dirname, '..', 'package.json'), 'utf8'));
|
|
24
|
+
const VERSION = pkg.version;
|
|
19
25
|
function fail(err) {
|
|
20
26
|
const msg = err instanceof Error ? err.message : String(err);
|
|
21
27
|
process.stderr.write(`${kleur.red('[error]')} ${msg}\n`);
|
package/package.json
CHANGED