Skip to content

Commit 6fac65e

Browse files
committed
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.
1 parent 23bff8b commit 6fac65e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app/plugins.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,15 @@ function install(fn) {
236236
env.npm_config_target = process.versions.electron;
237237
env.npm_config_disturl = 'https://atom.io/download/atom-shell';
238238
/* eslint-enable camelcase */
239-
exec('npm prune && npm install --production', {
239+
// Shell-specific installation commands
240+
const installCommands = {
241+
fish: 'npm prune; and npm install --production',
242+
default: 'npm prune && npm install --production'
243+
};
244+
// determine the shell we're running in
245+
const whichShell = shell.match(/fish/) ? 'fish' : 'default';
246+
// Use the install command that is appropriate for our shell
247+
exec(installCommands[whichShell], {
240248
cwd: path,
241249
env,
242250
shell

0 commit comments

Comments
 (0)