Unverified Commit 3001b330 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Try to make transitioning channels actually work. (#14353)

* Try to make transitioning channels actually work.

* Update upgrade.dart
parent 2580e6eb
...@@ -93,7 +93,7 @@ class ChannelCommand extends FlutterCommand { ...@@ -93,7 +93,7 @@ class ChannelCommand extends FlutterCommand {
static Future<Null> _checkout(String branchName) async { static Future<Null> _checkout(String branchName) async {
final int result = await runCommandAndStreamOutput( final int result = await runCommandAndStreamOutput(
<String>['git', 'checkout', branchName], <String>['git', 'checkout', '-b', branchName],
workingDirectory: Cache.flutterRoot, workingDirectory: Cache.flutterRoot,
prefix: 'git: ', prefix: 'git: ',
); );
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
import 'dart:async'; import 'dart:async';
import 'package:meta/meta.dart';
import '../base/common.dart'; import '../base/common.dart';
import '../base/file_system.dart'; import '../base/file_system.dart';
import '../base/os.dart'; import '../base/os.dart';
import '../base/process.dart'; import '../base/process.dart';
import '../cache.dart'; import '../cache.dart';
import '../dart/pub.dart'; import '../dart/pub.dart';
import '../doctor.dart';
import '../globals.dart'; import '../globals.dart';
import '../runner/flutter_command.dart'; import '../runner/flutter_command.dart';
import '../version.dart'; import '../version.dart';
...@@ -59,7 +60,7 @@ class UpgradeCommand extends FlutterCommand { ...@@ -59,7 +60,7 @@ class UpgradeCommand extends FlutterCommand {
printStatus('Upgrading engine...'); printStatus('Upgrading engine...');
code = await runCommandAndStreamOutput( code = await runCommandAndStreamOutput(
<String>[ <String>[
fs.path.join(Cache.flutterRoot, 'bin', 'flutter'), '--no-color', 'precache' fs.path.join('bin', 'flutter'), '--no-color', 'precache',
], ],
workingDirectory: Cache.flutterRoot, workingDirectory: Cache.flutterRoot,
allowReentrantFlutter: true allowReentrantFlutter: true
...@@ -68,16 +69,22 @@ class UpgradeCommand extends FlutterCommand { ...@@ -68,16 +69,22 @@ class UpgradeCommand extends FlutterCommand {
printStatus(''); printStatus('');
printStatus(flutterVersion.toString()); printStatus(flutterVersion.toString());
final String projRoot = findProjectRoot(); final String projectRoot = findProjectRoot();
if (projRoot != null) { if (projectRoot != null) {
printStatus(''); printStatus('');
await pubGet(context: PubContext.pubUpgrade, directory: projRoot, upgrade: true, checkLastModified: false); await pubGet(context: PubContext.pubUpgrade, directory: projectRoot, upgrade: true, checkLastModified: false);
} }
// Run a doctor check in case system requirements have changed. // Run a doctor check in case system requirements have changed.
printStatus(''); printStatus('');
printStatus('Running flutter doctor...'); printStatus('Running flutter doctor...');
await doctor.diagnose(); code = await runCommandAndStreamOutput(
<String>[
fs.path.join('bin', 'flutter'), 'doctor',
],
workingDirectory: Cache.flutterRoot,
allowReentrantFlutter: true,
);
} }
// dev/benchmarks/complex_layout/lib/main.dart | 24 +- // dev/benchmarks/complex_layout/lib/main.dart | 24 +-
...@@ -88,7 +95,7 @@ class UpgradeCommand extends FlutterCommand { ...@@ -88,7 +95,7 @@ class UpgradeCommand extends FlutterCommand {
// create mode 100644 examples/flutter_gallery/lib/gallery/demo.dart // create mode 100644 examples/flutter_gallery/lib/gallery/demo.dart
static final RegExp _gitChangedRegex = new RegExp(r' (rename|delete mode|create mode) .+'); static final RegExp _gitChangedRegex = new RegExp(r' (rename|delete mode|create mode) .+');
// Public for testing. @visibleForTesting
static bool matchesGitLine(String line) { static bool matchesGitLine(String line) {
return _gitDiffRegex.hasMatch(line) return _gitDiffRegex.hasMatch(line)
|| _gitChangedRegex.hasMatch(line) || _gitChangedRegex.hasMatch(line)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment