20 lines
638 B
Bash
20 lines
638 B
Bash
#!/bin/bash
|
|
|
|
# Устанавливаем кодировку консоли на UTF-8
|
|
export LANG=en_US.UTF-8
|
|
|
|
# Путь к снимку
|
|
SNAPSHOT_PATH="$HOME/AppData/Local/Pub/Cache/global_packages/fgen/bin/fgen.dart-3.5.2.snapshot"
|
|
|
|
# Проверяем, существует ли снимок
|
|
if [ -f "$SNAPSHOT_PATH" ]; then
|
|
dart "$SNAPSHOT_PATH" "$@"
|
|
# The VM exits with code 253 if the snapshot version is out-of-date.
|
|
# If it is, we need to delete it and run "pub global" manually.
|
|
if [ $? -ne 253 ]; then
|
|
exit $?
|
|
fi
|
|
fi
|
|
|
|
# Выполняем команду pub global run fgen:fgen
|
|
dart pub global run fgen:fgen "$@" |