Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
fix: remove app-root-path for version
Browse files Browse the repository at this point in the history
  • Loading branch information
starsprung committed Jan 3, 2021
1 parent f707aa2 commit ac42e4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 43 deletions.
29 changes: 1 addition & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"license": "MIT",
"dependencies": {
"amazon-order-reports-api": "^3.2.1",
"app-root-path": "^3.0.0",
"env-paths": "^2.2.0",
"hasha": "^5.2.2",
"inquirer": "^6.5.2",
Expand All @@ -44,7 +43,6 @@
"@semantic-release/github": "^7.2.0",
"@semantic-release/npm": "^7.0.9",
"@semantic-release/release-notes-generator": "^9.0.1",
"@types/app-root-path": "^1.2.4",
"@types/inquirer": "^7.3.1",
"@types/luxon": "^1.25.0",
"@types/mockdate": "^2.0.0",
Expand Down
15 changes: 2 additions & 13 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appRootPath from 'app-root-path';
import { version } from '../package.json';
import envPaths from 'env-paths';
import { readFileSync } from 'fs';
import { join } from 'path';
Expand Down Expand Up @@ -36,18 +36,7 @@ export const getConfig = (): Config => {
...((yargs(process.argv.slice(2))
.usage('Usage: $0 [options]')
.env()
.version(
((): string => {
try {
const content = readFileSync(appRootPath.resolve('package.json'), {
encoding: 'utf-8',
});
return JSON.parse(content).version;
} catch {
return 'unable to get version';
}
})(),
)
.version(version)
.option('amazon-otp-code', {
describe: 'Amazon OTP/2SV code',
type: 'string',
Expand Down

0 comments on commit ac42e4a

Please sign in to comment.