Skip to content

Commit

Permalink
small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
charliegerard committed Jan 17, 2024
1 parent b44930b commit b133204
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/commands/wrapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,16 @@ function setupCommand (name, description, argv, importMeta) {
const { enable, disable } = cli.flags

if (argv[0] === '--postinstall') {
installSafeNpm(`The Socket CLI is now successfully installed! 🎉
// Check if the wrapper is already enabled before showing the postinstall prompt
const socketWrapperEnabled = (fs.existsSync(BASH_FILE) && checkSocketWrapperAlreadySetup(BASH_FILE)) || (fs.existsSync(ZSH_BASH_FILE) && checkSocketWrapperAlreadySetup(BASH_FILE))

To better protect yourself against supply-chain attacks, our "safe npm" wrapper can warn you about malicious packages whenever you run 'npm install'.
if (!socketWrapperEnabled) {
installSafeNpm(`The Socket CLI is now successfully installed! 🎉
Do you want to install "safe npm" (this will create an alias to the socket-npm command)? (y/n)`)
To better protect yourself against supply-chain attacks, our "safe npm" wrapper can warn you about malicious packages whenever you run 'npm install'.
Do you want to install "safe npm" (this will create an alias to the socket-npm command)? (y/n)`)
}

return
}
Expand Down

0 comments on commit b133204

Please sign in to comment.