2019-02-21 16:03:56 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eux -o pipefail
|
|
|
|
# -e: exits if a command fails
|
|
|
|
# -u: errors if an variable is referenced before being set
|
|
|
|
# -x: shows the commands that get run
|
|
|
|
# -o pipefail: causes a pipeline to produce a failure return code if any command errors
|
|
|
|
|
|
|
|
# sedi makes `sed -i` work on both OSX & Linux
|
2019-02-21 15:56:41 -05:00
|
|
|
# See https://stackoverflow.com/questions/2320564/i-need-my-sed-i-command-for-in-place-editing-to-work-with-both-gnu-sed-and-bsd
|
|
|
|
sedi () {
|
2019-02-21 16:03:56 -05:00
|
|
|
case $(uname) in
|
|
|
|
Darwin*) sedi=('-i' '') ;;
|
|
|
|
*) sedi='-i' ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
sed "${sedi[@]}" "$@"
|
2019-02-21 15:56:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
sedi "s#packages-dist:#file://$PWD/../../dist/packages-dist/#" src/package.json
|