Skip to content

Commit

Permalink
Add support for the fish shell
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
knewter committed Dec 13, 2016
1 parent 23bff8b commit 6fac65e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,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',
default: 'npm prune && npm install --production'
};
// determine the shell we're running in
const whichShell = shell.match(/fish/) ? 'fish' : 'default';
// Use the install command that is appropriate for our shell
exec(installCommands[whichShell], {
cwd: path,
env,
shell
Expand Down

0 comments on commit 6fac65e

Please sign in to comment.