agent-flutter 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -135,8 +135,8 @@ normalize_project_name() {
|
|
|
135
135
|
|
|
136
136
|
append_path_once() {
|
|
137
137
|
local target="$1"
|
|
138
|
-
[[ -n "$target" ]] || return
|
|
139
|
-
[[ -d "$target" ]] || return
|
|
138
|
+
[[ -n "$target" ]] || return 0
|
|
139
|
+
[[ -d "$target" ]] || return 0
|
|
140
140
|
case ":$PATH:" in
|
|
141
141
|
*":$target:"*) ;;
|
|
142
142
|
*) export PATH="$PATH:$target" ;;
|
|
@@ -174,31 +174,33 @@ EOF
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
discover_working_fvm() {
|
|
177
|
-
local candidates=()
|
|
178
177
|
local candidate=""
|
|
179
178
|
local pub_cache_fvm="$HOME/.pub-cache/bin/fvm"
|
|
180
179
|
|
|
181
180
|
if command -v fvm >/dev/null 2>&1; then
|
|
182
|
-
|
|
181
|
+
candidate="$(command -v fvm)"
|
|
182
|
+
if "$candidate" --version >/dev/null 2>&1; then
|
|
183
|
+
FVM_BIN="$candidate"
|
|
184
|
+
return 0
|
|
185
|
+
fi
|
|
183
186
|
fi
|
|
184
187
|
|
|
185
188
|
if command -v which >/dev/null 2>&1; then
|
|
186
|
-
|
|
189
|
+
while IFS= read -r candidate; do
|
|
187
190
|
[[ -n "$candidate" ]] || continue
|
|
188
|
-
|
|
189
|
-
|
|
191
|
+
if "$candidate" --version >/dev/null 2>&1; then
|
|
192
|
+
FVM_BIN="$candidate"
|
|
193
|
+
return 0
|
|
194
|
+
fi
|
|
195
|
+
done <<< "$(which -a fvm 2>/dev/null || true)"
|
|
190
196
|
fi
|
|
191
197
|
|
|
192
198
|
if [[ -x "$pub_cache_fvm" ]]; then
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
for candidate in "${candidates[@]}"; do
|
|
197
|
-
if "$candidate" --version >/dev/null 2>&1; then
|
|
198
|
-
FVM_BIN="$candidate"
|
|
199
|
+
if "$pub_cache_fvm" --version >/dev/null 2>&1; then
|
|
200
|
+
FVM_BIN="$pub_cache_fvm"
|
|
199
201
|
return 0
|
|
200
202
|
fi
|
|
201
|
-
|
|
203
|
+
fi
|
|
202
204
|
|
|
203
205
|
return 1
|
|
204
206
|
}
|