Pass flags along in 'publish' script.

This commit is contained in:
Sergio Benitez 2018-10-29 04:55:18 -07:00
parent ef3e7ca2c6
commit 4b5000e33b
2 changed files with 8 additions and 9 deletions

1
.gitignore vendored
View File

@ -19,6 +19,7 @@ Cargo.lock
# The upload script, for now. # The upload script, for now.
scripts/upload-docs.sh scripts/upload-docs.sh
scripts/redirect.html
# Backup files. # Backup files.
*.bak *.bak

View File

@ -5,17 +5,10 @@ set -e
# Publishes the current versions of all Rocket crates to crates.io. # Publishes the current versions of all Rocket crates to crates.io.
# #
# FIXME: Check for FIXMEs before publishing!..?
# Brings in _ROOT, _DIR, _DIRS globals. # Brings in _ROOT, _DIR, _DIRS globals.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${SCRIPT_DIR}/config.sh" source "${SCRIPT_DIR}/config.sh"
if ! [ -z "$(git status --porcelain)" ]; then
echo "There are uncommited changes! Aborting."
exit 1
fi
function strip_dev_dependencies() { function strip_dev_dependencies() {
perl -i.bak -p0e 's/\[dev-dependencies\][^\[]*//smg' "${1}/Cargo.toml" 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" 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. # Ensure everything passes before trying to publish.
echo ":::: Running test suite..." echo ":::: Running test suite..."
cargo clean cargo clean
@ -39,9 +37,9 @@ done
# Publish all the things. # Publish all the things.
for dir in "${ALL_PROJECT_DIRS[@]}"; do for dir in "${ALL_PROJECT_DIRS[@]}"; do
pushd "${dir}" pushd "${dir}"
echo ":::: Publishing '${dir}..." echo ":::: Publishing '${dir}'..."
# We already checked things ourselves. Don't spend time reverifying. # We already checked things ourselves. Don't spend time reverifying.
cargo publish --no-verify --allow-dirty cargo publish --no-verify --allow-dirty ${@:1}
popd popd
done done