blob: ee5f893d1f14b9d488277838cc276e6d7f0a665b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd "$DIR" > /dev/null
# Optimize
shift
if ! which $(npm bin)/grunt ; then
echo "Could not find grunt. Please run 'npm install' then retry." >&2
exit 1
fi
$(npm bin)/grunt "$@" || echo "Grunt build failed." >&2 && exit 1
# Pack tarball
tarball=$(npm pack)
RC=$?
if [ "$RC" == "0" ]; then
echo "pack succeeded! Please sanity check $tarball and if it looks OK, run:"
echo
echo "npm publish $tarball"
else
echo "pack failed :(" &>2
exit $RC
fi
|