From 433f37987c66d50d5ed0793916eb1a2adfc48e4d Mon Sep 17 00:00:00 2001 From: Charlie Gerard Date: Fri, 19 Jan 2024 10:46:17 -0800 Subject: [PATCH 1/2] fix --- lib/commands/wrapper/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/commands/wrapper/index.js b/lib/commands/wrapper/index.js index 63d5105..219f061 100644 --- a/lib/commands/wrapper/index.js +++ b/lib/commands/wrapper/index.js @@ -52,7 +52,13 @@ function setupCommand (name, description, argv, importMeta) { if (argv[0] === '--postinstall') { // 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)) + let socketWrapperEnabled + if (fs.existsSync(BASH_FILE)) { + socketWrapperEnabled = checkSocketWrapperAlreadySetup(BASH_FILE) + } + if (fs.existsSync(ZSH_BASH_FILE)) { + socketWrapperEnabled = checkSocketWrapperAlreadySetup(ZSH_BASH_FILE) + } if (!socketWrapperEnabled) { installSafeNpm(`The Socket CLI is now successfully installed! 🎉 From c16589b255722a4db27d3fbc6d6ddead82c1cdcb Mon Sep 17 00:00:00 2001 From: Charlie Gerard Date: Fri, 19 Jan 2024 10:59:11 -0800 Subject: [PATCH 2/2] better update --- lib/commands/wrapper/index.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/commands/wrapper/index.js b/lib/commands/wrapper/index.js index 219f061..35c38dc 100644 --- a/lib/commands/wrapper/index.js +++ b/lib/commands/wrapper/index.js @@ -52,13 +52,7 @@ function setupCommand (name, description, argv, importMeta) { if (argv[0] === '--postinstall') { // Check if the wrapper is already enabled before showing the postinstall prompt - let socketWrapperEnabled - if (fs.existsSync(BASH_FILE)) { - socketWrapperEnabled = checkSocketWrapperAlreadySetup(BASH_FILE) - } - if (fs.existsSync(ZSH_BASH_FILE)) { - socketWrapperEnabled = checkSocketWrapperAlreadySetup(ZSH_BASH_FILE) - } + const socketWrapperEnabled = (fs.existsSync(BASH_FILE) && checkSocketWrapperAlreadySetup(BASH_FILE)) || (fs.existsSync(ZSH_BASH_FILE) && checkSocketWrapperAlreadySetup(ZSH_BASH_FILE)) if (!socketWrapperEnabled) { installSafeNpm(`The Socket CLI is now successfully installed! 🎉