From 993b8f6833bffe75032e9f161fd17bed0c98ed73 Mon Sep 17 00:00:00 2001 From: Josh Adams Date: Sat, 21 Jan 2017 19:03:58 +0000 Subject: [PATCH] Add support for the fish shell (#1181) * Add support for the fish shell Fixes #1142 The fish shell is not POSIX-compliant. As a result, the installation command's use of `&&` caused `updatePlugins` to fail, erroneously claiming there would be details in `~/.hyper_plugins/npm-debug.log`. They of course weren't there because the command it tried to run was an invalid command. I've added an object to choose the install command to run based on the shell you're in, and a very basic test to determine if we're in fish. Most shells should be able to be handled by the 'default' key, so for now it just checks to see if it's fish by doing a regex on the configured `shell` option. * Rename default -> posix --- app/plugins.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/plugins.js b/app/plugins.js index ef11dc6f..f0366982 100644 --- a/app/plugins.js +++ b/app/plugins.js @@ -235,7 +235,15 @@ function install(fn) { env.npm_config_target = process.versions.electron; env.npm_config_disturl = 'https://atom.io/download/atom-shell'; /* eslint-enable camelcase */ - exec('npm prune && npm install --production', { + // Shell-specific installation commands + const installCommands = { + fish: 'npm prune; and npm install --production', + posix: 'npm prune && npm install --production' + }; + // determine the shell we're running in + const whichShell = shell.match(/fish/) ? 'fish' : 'posix'; + // Use the install command that is appropriate for our shell + exec(installCommands[whichShell], { cwd: path, env, shell