Skip to content

Commit

Permalink
Lint nits
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Dec 8, 2024
1 parent 34350ae commit 158be14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
20 changes: 6 additions & 14 deletions src/commands/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,21 +895,13 @@ export const optimize: CliSubcommand = {
try {
if (isNpm) {
const wrapperPath = path.join(distPath, 'npm-cli.js')
await spawn(
process.execPath,
[
wrapperPath,
'install',
'--silent'
],
{
stdio: 'ignore',
env: {
...process.env,
[UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE]: '1'
}
await spawn(process.execPath, [wrapperPath, 'install', '--silent'], {
stdio: 'ignore',
env: {
...process.env,
[UPDATE_SOCKET_OVERRIDES_IN_PACKAGE_LOCK_FILE]: '1'
}
)
})
} else {
// All package managers support the "install" command.
await spawn(agentExecPath, ['install'], { stdio: 'ignore' })
Expand Down
12 changes: 4 additions & 8 deletions test/socket-npm.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ for (const npm of ['npm8', 'npm10']) {
const npmPath = path.join(npmFixturesPath, npm)
const npmBinPath = path.join(npmPath, 'node_modules', '.bin')

spawnSync(
'npm',
['install', '--silent'],
{
cwd: npmPath,
stdio: 'ignore'
}
)
spawnSync('npm', ['install', '--silent'], {
cwd: npmPath,
stdio: 'ignore'
})

describe(`Socket npm wrapper for ${npm}`, () => {
it('should bail on new typosquat', async () => {
Expand Down

0 comments on commit 158be14

Please sign in to comment.