Skip to content

Commit f8f9736

Browse files
committed
Minor tweaks
1 parent 511e63a commit f8f9736

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

action.sh

+19-15
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,29 @@ echo "::group::Setting up FVM workspace"
1717
if cd ${FVM_WORKSPACE}; then
1818
echo "Changed workspace directory to ${FVM_WORKSPACE}"
1919
else
20-
echo "Failed to change workspace directory to ${FVM_WORKSPACE}"
20+
echo "::error::Failed to change workspace directory to ${FVM_WORKSPACE}"
2121
exit 1
2222
fi
2323

24-
if [ -f ".fvmrc" ]; then
25-
echo "Detected .fvmrc file, using it to install Flutter SDK"
26-
echo -e "yes\nyes\n" | fvm install
24+
# Check if .fvmrc file exists
25+
if [ ! -f ".fvmrc" ]; then
26+
echo "::error::No .fvmrc file found in the workspace. Please create one to specify the Flutter SDK version."
27+
exit 1
28+
fi
2729

28-
# Invoke Flutter SDK to suppress the analytics.
29-
fvm flutter --version --suppress-analytics 2>&1 >/dev/null
30+
echo "Detected .fvmrc file, using it to install Flutter SDK"
31+
echo -e "yes\nyes\n" | fvm install
3032

31-
# Disable Google Analytics and CLI animations
32-
fvm flutter config --no-analytics 2>&1 >/dev/null
33-
fvm flutter config --no-cli-animations 2>&1 >/dev/null
33+
# Invoke Flutter SDK to suppress the analytics.
34+
fvm flutter --version --suppress-analytics 2>&1 >/dev/null
3435

35-
# Report success, and print version.
36-
echo "Succesfully installed Flutter SDK:"
37-
echo "------------------------------------------------------------------------------"
38-
fvm dart --version
39-
fvm flutter --version
40-
fi
36+
# Disable Google Analytics and CLI animations
37+
fvm flutter config --no-analytics 2>&1 >/dev/null
38+
fvm flutter config --no-cli-animations 2>&1 >/dev/null
39+
40+
# Report success, and print version.
41+
echo "Succesfully installed Flutter SDK:"
42+
echo "------------------------------------------------------------------------------"
43+
fvm dart --version
44+
fvm flutter --version
4145
echo "::endgroup::"

0 commit comments

Comments
 (0)