0
1
How can I assign this alias to my new mac with Yosemite?
alias in = "npm install && bower install"
0
1
How can I assign this alias to my new mac with Yosemite?
alias in = "npm install && bower install"
1
Add the alias
directive to your ~/.bashrc
file. You'll need to remove the spaces around the =
symbol for bash to parse the command correctly:
alias in="npm install && bower install"
You could allow the caller to specify a package name if you use a shell function instead of an alias. Here we pass the same argument to both npm
and bower
(note, use "$@"
instead of $1
if there is more than one argument):
in() {
npm install $1 && bower install $1
}
do I have to shut all my terminal windows, or open new ones to use this? – SuperUberDuper – 2015-02-16T10:49:57.790
source ~/.bashrc
to take effect in an existing shell. – zackse – 2015-02-17T02:03:10.910I have this: alias sd=“—save-dev” but in terminal I type
sd
I get:-bash: sd: command not found – SuperUberDuper – 2015-02-18T17:37:13.5901A
bash
alias can only be used as a command, not an argument. To create a shortcut for a command-line option, you would need to use an alias that includes the option (e.g.,alias sd='npm install --save-dev'
or use an environment variable (export SD='--save-dev'
) and then issuenpm install $SD
which really doesn't save much typing. – zackse – 2015-02-18T18:57:35.303