mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-26 00:32:45 +03:00
Merge pull request #3 from uqbar-dao/da/script-release
--release is now default
This commit is contained in:
commit
e45cb570ba
16
build-app.sh
16
build-app.sh
@ -1,23 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
release_flag=""
|
||||
debug_flag="--release"
|
||||
|
||||
if [ $# -ne 1 ] && [ $# -ne 2 ]; then
|
||||
echo "Usage: $0 <name> [--release]"
|
||||
echo "Usage: $0 <name> [--debug]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
name="$1"
|
||||
|
||||
if [[ "$2" == "--release" ]]; then
|
||||
release_flag="--release"
|
||||
if [[ "$2" == "--debug" ]]; then
|
||||
debug_flag=""
|
||||
fi
|
||||
|
||||
pwd=$(pwd)
|
||||
|
||||
# Check if the --release flag is present
|
||||
if [[ "$@" == *"--release"* ]]; then
|
||||
release_flag="--release"
|
||||
# Check if the --debug flag is present
|
||||
if [[ "$@" == *"--debug"* ]]; then
|
||||
debug_flag="--release"
|
||||
fi
|
||||
|
||||
rm -rf "$pwd/modules/$name/wit" || { echo "Command failed"; exit 1; }
|
||||
@ -31,7 +31,7 @@ mkdir -p "$pwd/modules/$name/target/wasm32-unknown-unknown/release" || { echo "C
|
||||
|
||||
# Build the module using Cargo
|
||||
cargo build \
|
||||
$release_flag \
|
||||
$debug_flag \
|
||||
--no-default-features \
|
||||
--manifest-path="$pwd/modules/$name/Cargo.toml"\
|
||||
--target "wasm32-wasi" || {
|
||||
|
10
build.sh
10
build.sh
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
all=false
|
||||
release=""
|
||||
debug="--release"
|
||||
|
||||
# prase arguments (--all, --release)
|
||||
for arg in "$@"; do
|
||||
@ -9,8 +9,8 @@ for arg in "$@"; do
|
||||
--all)
|
||||
all=true
|
||||
;;
|
||||
--release)
|
||||
release="--release"
|
||||
--debug)
|
||||
debug="--release"
|
||||
;;
|
||||
*)
|
||||
echo "Error: Unrecognized argument: $arg"
|
||||
@ -40,7 +40,7 @@ if $all; then
|
||||
# Check if it's a directory
|
||||
if [ -d "$dir" ]; then
|
||||
dir_name=$(basename "$dir")
|
||||
./build-app.sh "$dir_name" $release
|
||||
./build-app.sh "$dir_name" $debug
|
||||
fi
|
||||
done
|
||||
# else just compile the ones that have git changes
|
||||
@ -53,6 +53,6 @@ if $all; then
|
||||
else
|
||||
DIRS=($(git -C . status --porcelain | grep 'modules/' | sed -n 's|^.*modules/\([^/]*\)/.*$|\1|p' | sort -u))
|
||||
for dir in "${DIRS[@]}"; do
|
||||
./build-app.sh $dir $release
|
||||
./build-app.sh $dir $debug
|
||||
done
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user