From 4b5000e33bb3d7877972006c3c100aa6aa564738 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Mon, 29 Oct 2018 04:55:18 -0700 Subject: [PATCH] Pass flags along in 'publish' script. --- .gitignore | 1 + scripts/publish.sh | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 6f8c64bb..5766c574 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ Cargo.lock # The upload script, for now. scripts/upload-docs.sh +scripts/redirect.html # Backup files. *.bak diff --git a/scripts/publish.sh b/scripts/publish.sh index a778e072..a59085df 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -5,17 +5,10 @@ set -e # Publishes the current versions of all Rocket crates to crates.io. # -# FIXME: Check for FIXMEs before publishing!..? - # Brings in _ROOT, _DIR, _DIRS globals. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" source "${SCRIPT_DIR}/config.sh" -if ! [ -z "$(git status --porcelain)" ]; then - echo "There are uncommited changes! Aborting." - exit 1 -fi - function strip_dev_dependencies() { perl -i.bak -p0e 's/\[dev-dependencies\][^\[]*//smg' "${1}/Cargo.toml" } @@ -24,6 +17,11 @@ function restore_dev_dependencies() { mv "${1}/Cargo.toml.bak" "${1}/Cargo.toml" } +if ! [ -z "$(git status --porcelain)" ]; then + echo "There are uncommited changes! Aborting." + exit 1 +fi + # Ensure everything passes before trying to publish. echo ":::: Running test suite..." cargo clean @@ -39,9 +37,9 @@ done # Publish all the things. for dir in "${ALL_PROJECT_DIRS[@]}"; do pushd "${dir}" - echo ":::: Publishing '${dir}..." + echo ":::: Publishing '${dir}'..." # We already checked things ourselves. Don't spend time reverifying. - cargo publish --no-verify --allow-dirty + cargo publish --no-verify --allow-dirty ${@:1} popd done