-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sketch of a .envrc for using fvm's flutter add notes in notice add note to comment out check flutter version update README
- Loading branch information
Showing
6 changed files
with
87 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This file is used by direnv to setup the environment when entering to use fvm's flutter. | ||
|
||
# Comment out the next line if you want to use your system flutter. | ||
PATH_add .fvm/flutter_sdk/bin | ||
|
||
# Check flutter version matches what's in .fvmrc | ||
check_flutter_version() { | ||
local fvm_flutter_version_string=$(cat .fvmrc) | ||
# Fetch string from format `"flutter": "18340ea16c"`` | ||
local fvm_flutter_version=$(echo "$fvm_flutter_version_string" | grep -o '"flutter": "[a-z0-9]*"' | cut -d '"' -f 4) | ||
|
||
local flutter_version_string=$(flutter --version) | ||
# Fetch string from format `Framework • revision 11c034f037` | ||
local flutter_version=$(echo $flutter_version_string | grep -o 'Framework • revision [a-z0-9]*' | cut -d ' ' -f 4) | ||
|
||
if [ "$fvm_flutter_version" != "$flutter_version" ]; then | ||
echo "Flutter version mismatch: $fvm_flutter_version != $flutter_version" | ||
echo "Expected Flutter version: $fvm_flutter_version" | ||
echo "Actual Flutter version: $flutter_version" | ||
echo "Run 'fvm install' to fix this or see README on Setup." | ||
return 1 | ||
fi | ||
} | ||
|
||
# Check flutter version when entering directory | ||
# Comment this out at your own risk if you want to use a custom flutter version. | ||
check_flutter_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"flutter": "18340ea16c", | ||
"updateVscodeSettings": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,6 @@ app.*.map.json | |
|
||
# Old scaffolding hack | ||
lib/credential_fixture.dart | ||
|
||
# FVM Version Cache | ||
.fvm/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters