mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-06-16 09:29:43 -07:00
add set_versions.sh
This commit is contained in:
committed by
Will Greenberg
parent
772dac681e
commit
ce821b825f
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# Sets Rayhunter package versions in preparation for a release.
|
||||
#
|
||||
# Usage: ./scripts/set-versions.sh VERSION_NUM
|
||||
# Example: ./scripts/set-versions.sh 0.12.3
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
cd "$PROJECT_DIR"
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Error: Missing required version number argument."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SED_COMMAND="s/^version = \".*\"/version = \"$1\"/"
|
||||
TOML_FILES=(*/Cargo.toml installer-gui/src-tauri/Cargo.toml)
|
||||
|
||||
echo "Updating Cargo.toml files"
|
||||
if sed --version > /dev/null 2>&1; then
|
||||
# we have GNU sed
|
||||
sed -i -E "$SED_COMMAND" "${TOML_FILES[@]}"
|
||||
else
|
||||
# we have macOS/BSD sed
|
||||
sed -i "" -E "$SED_COMMAND" "${TOML_FILES[@]}"
|
||||
fi
|
||||
|
||||
echo "Updating Cargo.lock"
|
||||
cargo update --workspace
|
||||
Reference in New Issue
Block a user