Variable for builds directory

This commit is contained in:
Tim Schaub
2014-12-20 02:55:56 -07:00
parent d4763a0fe7
commit 9b0349f2d5

View File

@@ -13,6 +13,11 @@ set -o errexit
#
PROFILES="ol ol-debug"
#
# Destination directory for builds.
#
BUILDS=dist
#
# URL for canonical repo.
#
@@ -35,7 +40,6 @@ display_usage() {
The tag must be pushed to ${REMOTE} before the release can be published.
EOF
exit 1
}
#
@@ -62,8 +66,8 @@ assert_version_match() {
#
build_profiles() {
for p in ${@}; do
echo building dist/${p}.js
node ./tasks/build.js config/${p}.json dist/${p}.js
echo building ${BUILDS}/${p}.js
node ./tasks/build.js config/${p}.json ${BUILDS}/${p}.js
done
}
@@ -78,19 +82,21 @@ checkout_tag() {
#
# Build all profiles and publish.
#
main() {
root=$(cd -P -- "$(dirname -- "${0}")" && pwd -P)/..
cd ${root}
assert_clean
checkout_tag ${1}
assert_version_match ${1}
rm -rf dist
rm -rf ${BUILDS}
build_profiles ${PROFILES}
npm publish
}
if test ${#} -ne 1; then
display_usage ${0}
exit 1
else
main ${1}
fi