File tree Expand file tree Collapse file tree 1 file changed +24
-10
lines changed
Expand file tree Collapse file tree 1 file changed +24
-10
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash -e
2- THIS_VERSION=2024-09-09
2+ THIS_VERSION=2025-06-18
33
44cat << 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
You can’t perform that action at this time.
0 commit comments