Skip to content

Commit

Permalink
perf: deps revision
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Aug 22, 2020
1 parent 96bde5d commit c35b253
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"fs-extra": "^9.0.1",
"minimist": "^1.2.5",
"npm": "7.0.0-beta.4",
"pkg-dir": "^4.2.0",
"tslib": "^2.0.1"
},
"devDependencies": {
Expand Down
6 changes: 4 additions & 2 deletions src/main/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ const yarnLockToPkgLock: TCallback = ({temp}) => {
* @return {void}
*/
const npmAuditFix: TCallback = ({temp, flags}) => {
invoke(getNpmBin(), [
const auditArgs = [
'audit', 'fix', '--package-lock-only',
...formatFlags(flags, 'verbose', 'loglevel', 'only', 'force', 'audit-level', 'silent'),
], temp, flags.silent)
]

invoke(getNpmBin(), auditArgs, temp, flags.silent)
}

/**
Expand Down
5 changes: 2 additions & 3 deletions src/main/ts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import cp from 'child_process'
import chalk from 'chalk'
import {FsSymlinkType, readFileSync} from 'fs-extra'
import minimist from 'minimist'
import {join} from 'path'
import {sync as pkgDir} from 'pkg-dir'
import {join, resolve} from 'path'
import glob, {Options as GlobOptions} from 'bash-glob'

export const invoke = (cmd: string, args: string[], cwd: string, silent= false) => {
Expand Down Expand Up @@ -47,7 +46,7 @@ export const getSymlinkType = (type?: string): FsSymlinkType =>
? type
: 'dir'

export const getNpmBin = () => join(pkgDir(__dirname) as string, 'node_modules/.bin/npm')
export const getNpmBin = () => resolve(require.resolve('npm'), '../../../.bin/npm')

export const getWorkspaces = (cwd: string) => {
const manifest = readJson(join(cwd, 'package.json'))
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7865,7 +7865,7 @@ tar@^4.4.10, tar@^4.4.12, tar@^4.4.13:
tar@^6.0.1, tar@^6.0.2:
version "6.0.5"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.5.tgz#bde815086e10b39f1dcd298e89d596e1535e200f"
integrity sha1-vegVCG4Qs58dzSmOidWW4VNeIA8=
integrity sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg==
dependencies:
chownr "^2.0.0"
fs-minipass "^2.0.0"
Expand Down

0 comments on commit c35b253

Please sign in to comment.