Skip to content
Permalink
latest
Switch branches/tags
Go to file
On BSD platforms, there is a clear seperation between the OS and third
party packages. Here, bash is a third party package so it won't be
installed to /bin.

FreeBSD:	/usr/local/bin/bash
NetBSD:		/usr/pkg/bin/bash
OpenBSD:	/usr/ports/bin/bash

As such, we need to use /usr/bin/env to launch these scripts.

Credit: @rsmarples
PR-URL: #212
Close: #212
Reviewed-by: @isaacs
2 contributors

Users who have contributed to this file

@isaacs @rsmarples
executable file 33 lines (28 sloc) 529 Bytes
#!/usr/bin/env bash
# set configurations that will be "sticky" on this system,
# surviving npm self-updates.
CONFIGS=()
i=0
# get the location of this file.
unset CDPATH
CONFFILE=$(cd $(dirname "$0"); pwd -P)/npmrc
while [ $# -gt 0 ]; do
conf="$1"
case $conf in
--help)
echo "./configure --param=value ..."
exit 0
;;
--*)
CONFIGS[$i]="${conf:2}"
;;
*)
CONFIGS[$i]="$conf"
;;
esac
let i++
shift
done
for c in "${CONFIGS[@]}"; do
echo "$c" >> "$CONFFILE"
done