-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from edumudu/fix/get-right-version
Fix the version showed when using the `--version flag`
- Loading branch information
Showing
2 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import path from 'path'; | ||
import os from 'os'; | ||
import { createRequire } from 'module'; | ||
|
||
const require = createRequire(import.meta.url); | ||
const { version } = require('../package.json'); | ||
|
||
export const packageDir = path.join(os.homedir(), '.loctry'); | ||
export const modulesRoot = path.join(packageDir, 'node_modules'); | ||
export const packagesInfoPath = path.join(packageDir, 'packages-info.json'); | ||
export const currentVersion = version; |