agent-flutter 0.1.17 → 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
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
set -Eeuo pipefail
|
|
3
3
|
trap 'echo "Error at line $LINENO: $BASH_COMMAND" >&2' ERR
|
|
4
4
|
|
|
5
|
+
if [[ -z "${BASH_VERSION:-}" ]]; then
|
|
6
|
+
echo "Error: Please run this script with bash." >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
9
|
+
|
|
5
10
|
usage() {
|
|
6
11
|
cat <<'EOF'
|
|
7
12
|
Bootstrap a new Flutter template project (script-first workflow).
|
|
@@ -130,8 +135,8 @@ normalize_project_name() {
|
|
|
130
135
|
|
|
131
136
|
append_path_once() {
|
|
132
137
|
local target="$1"
|
|
133
|
-
[[ -n "$target" ]] || return
|
|
134
|
-
[[ -d "$target" ]] || return
|
|
138
|
+
[[ -n "$target" ]] || return 0
|
|
139
|
+
[[ -d "$target" ]] || return 0
|
|
135
140
|
case ":$PATH:" in
|
|
136
141
|
*":$target:"*) ;;
|
|
137
142
|
*) export PATH="$PATH:$target" ;;
|
|
@@ -169,31 +174,33 @@ EOF
|
|
|
169
174
|
}
|
|
170
175
|
|
|
171
176
|
discover_working_fvm() {
|
|
172
|
-
local candidates=()
|
|
173
177
|
local candidate=""
|
|
174
178
|
local pub_cache_fvm="$HOME/.pub-cache/bin/fvm"
|
|
175
179
|
|
|
176
180
|
if command -v fvm >/dev/null 2>&1; then
|
|
177
|
-
|
|
181
|
+
candidate="$(command -v fvm)"
|
|
182
|
+
if "$candidate" --version >/dev/null 2>&1; then
|
|
183
|
+
FVM_BIN="$candidate"
|
|
184
|
+
return 0
|
|
185
|
+
fi
|
|
178
186
|
fi
|
|
179
187
|
|
|
180
188
|
if command -v which >/dev/null 2>&1; then
|
|
181
189
|
while IFS= read -r candidate; do
|
|
182
190
|
[[ -n "$candidate" ]] || continue
|
|
183
|
-
|
|
184
|
-
|
|
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)"
|
|
185
196
|
fi
|
|
186
197
|
|
|
187
198
|
if [[ -x "$pub_cache_fvm" ]]; then
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
for candidate in "${candidates[@]}"; do
|
|
192
|
-
if "$candidate" --version >/dev/null 2>&1; then
|
|
193
|
-
FVM_BIN="$candidate"
|
|
199
|
+
if "$pub_cache_fvm" --version >/dev/null 2>&1; then
|
|
200
|
+
FVM_BIN="$pub_cache_fvm"
|
|
194
201
|
return 0
|
|
195
202
|
fi
|
|
196
|
-
|
|
203
|
+
fi
|
|
197
204
|
|
|
198
205
|
return 1
|
|
199
206
|
}
|