Document extension bump process (#18872)
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
parent
7960468d8a
commit
f33019c885
2 changed files with 92 additions and 0 deletions
29
script/language-extension-version
Executable file
29
script/language-extension-version
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euox pipefail
|
||||
|
||||
if [ "$#" -lt 1 ]; then
|
||||
echo "Usage: $0 <language> [version]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LANGUAGE=$1
|
||||
VERSION=${2:-}
|
||||
|
||||
EXTENSION_DIR="extensions/$LANGUAGE"
|
||||
EXTENSION_TOML="$EXTENSION_DIR/extension.toml"
|
||||
CARGO_TOML="$EXTENSION_DIR/Cargo.toml"
|
||||
|
||||
if [ ! -d "$EXTENSION_DIR" ]; then
|
||||
echo "Directory $EXTENSION_DIR does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
grep -m 1 'version =' "$EXTENSION_TOML" | awk -F\" '{print $2}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
sed -i '' -e "s/^version = \".*\"/version = \"$VERSION\"/" "$EXTENSION_TOML"
|
||||
sed -i '' -e "s/^version = \".*\"/version = \"$VERSION\"/" "$CARGO_TOML"
|
||||
cargo check
|
Loading…
Add table
Add a link
Reference in a new issue