Skip to content

Commit eefcc06

Browse files
committed
💚 wings release support web monorepo
1 parent 938d751 commit eefcc06

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

observe/scripts/wings-release.sh

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -e
2-
THIS_VERSION=2024-09-09
2+
THIS_VERSION=2025-06-18
33

44
cat <<EOF
55
#################################################
@@ -120,14 +120,22 @@ function build_web() {
120120
_pre_pack
121121

122122
_cmd=$1
123-
if [[ "$_cmd" == "" ]]; then
124-
if [[ -f "pnpm-lock.yaml" ]]; then
125-
_cmd=pnpm
126-
elif [[ -f "yarn.lock" ]]; then
127-
_cmd=yarn
128-
elif [[ -f "package-lock.json" ]]; then
129-
_cmd=npm
123+
if [[ -z "$_cmd" ]]; then
124+
_cw="$PWD"
125+
for _ in {0..3}; do
126+
if [[ -f "$_cw/pnpm-lock.yaml" ]]; then
127+
_cmd=pnpm
128+
break
129+
elif [[ -f "$_cw/yarn.lock" ]]; then
130+
_cmd=yarn
131+
break
132+
elif [[ -f "$_cw/package-lock.json" ]]; then
133+
_cmd=npm
134+
break
135+
else
136+
_cw="$(dirname "$_cw")"
130137
fi
138+
done
131139
fi
132140

133141
# build
@@ -174,9 +182,15 @@ function build_auto() {
174182
fi
175183

176184
## https://asdf-vm.com
177-
if [[ -f ".tool-versions" ]]; then
185+
_cw="$PWD"
186+
for _ in {0..3}; do
187+
if [[ -f "$_cw/.tool-versions" ]]; then
178188
check_cmd asdf "$HOME/.asdf/asdf.sh" && asdf install
179-
fi
189+
break
190+
else
191+
_cw="$(dirname "$_cw")"
192+
fi
193+
done
180194

181195
# mvn
182196
if [[ -f "pom.xml" || "$1" == "mvn" ]]; then

0 commit comments

Comments
 (0)