-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from leoafarias/feature/display-progress
Changes to process runners, and improved version validation
- Loading branch information
Showing
15 changed files
with
105 additions
and
85 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
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
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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 |
---|---|---|
@@ -1,21 +1,28 @@ | ||
import 'package:fvm/exceptions.dart'; | ||
import 'package:fvm/utils/flutter_tools.dart'; | ||
import 'package:fvm/utils/logger.dart'; | ||
import 'package:io/ansi.dart'; | ||
import 'package:fvm/utils/helpers.dart'; | ||
import 'package:fvm/utils/print.dart'; | ||
|
||
Future<void> installFlutterVersion( | ||
String flutterVersion, | ||
) async { | ||
if (flutterVersion == null) { | ||
Future<void> installFlutterVersion(String version, | ||
{bool skipSetup = false}) async { | ||
if (version == null) { | ||
throw ExceptionMissingChannelVersion(); | ||
} | ||
final version = flutterVersion.toLowerCase(); | ||
|
||
final progress = logger.progress(green.wrap('Downloading $version')); | ||
// Skips line in progress | ||
print(''); | ||
// If it's installed correctly just return and use cached | ||
if (isInstalledCorrectly(version)) { | ||
Print.success('Version: $version - already installed.'); | ||
return; | ||
} | ||
|
||
Print.success('Installing Version: $version:'); | ||
|
||
await flutterVersionClone(version); | ||
await gitCloneCmd(version); | ||
|
||
finishProgress(progress); | ||
// Skips Flutter sdk setup | ||
if (skipSetup) return; | ||
Print.success('Setting up Flutter sdk'); | ||
Print.info('If you want to skip this next time use "--skip-setup"'); | ||
final flutterExec = getFlutterSdkExec(version: version); | ||
await flutterCmd(flutterExec, ['--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
Oops, something went wrong.