@lumiflora/fsdk 0.1.4 → 0.1.5
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 +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
|
-
import
|
|
4
|
+
import fs from 'fs';
|
|
5
5
|
import cac from 'cac';
|
|
6
6
|
import { logger, enableDebugMode, resolveCwd } from './utils/index.js';
|
|
7
7
|
import { configLoader, pluginSystem } from './core/index.js';
|
|
@@ -12,9 +12,9 @@ import { createApp, addPage, addComponent, addStore, syncTemplate, validate, pre
|
|
|
12
12
|
const cliEntryPath = fileURLToPath(import.meta.url);
|
|
13
13
|
const cliRoot = path.dirname(path.dirname(cliEntryPath));
|
|
14
14
|
global.__cliRoot = cliRoot;
|
|
15
|
-
//
|
|
16
|
-
const
|
|
17
|
-
const pkg =
|
|
15
|
+
// Read package.json to get version
|
|
16
|
+
const pkgPath = path.join(cliRoot, 'package.json');
|
|
17
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
18
18
|
const cli = cac('fsdk');
|
|
19
19
|
cli
|
|
20
20
|
.version(pkg.version)
|