Skip to content

Commit

Permalink
Try to make transitioning channels actually work. (flutter#14353)
Browse files Browse the repository at this point in the history
* Try to make transitioning channels actually work.

* Update upgrade.dart
  • Loading branch information
Hixie committed Jan 30, 2018
1 parent 2580e6e commit 3001b33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/commands/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ChannelCommand extends FlutterCommand {

static Future<Null> _checkout(String branchName) async {
final int result = await runCommandAndStreamOutput(
<String>['git', 'checkout', branchName],
<String>['git', 'checkout', '-b', branchName],
workingDirectory: Cache.flutterRoot,
prefix: 'git: ',
);
Expand Down
21 changes: 14 additions & 7 deletions packages/flutter_tools/lib/src/commands/upgrade.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

import 'dart:async';

import 'package:meta/meta.dart';

import '../base/common.dart';
import '../base/file_system.dart';
import '../base/os.dart';
import '../base/process.dart';
import '../cache.dart';
import '../dart/pub.dart';
import '../doctor.dart';
import '../globals.dart';
import '../runner/flutter_command.dart';
import '../version.dart';
Expand Down Expand Up @@ -59,7 +60,7 @@ class UpgradeCommand extends FlutterCommand {
printStatus('Upgrading engine...');
code = await runCommandAndStreamOutput(
<String>[
fs.path.join(Cache.flutterRoot, 'bin', 'flutter'), '--no-color', 'precache'
fs.path.join('bin', 'flutter'), '--no-color', 'precache',
],
workingDirectory: Cache.flutterRoot,
allowReentrantFlutter: true
Expand All @@ -68,16 +69,22 @@ class UpgradeCommand extends FlutterCommand {
printStatus('');
printStatus(flutterVersion.toString());

final String projRoot = findProjectRoot();
if (projRoot != null) {
final String projectRoot = findProjectRoot();
if (projectRoot != null) {
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.
printStatus('');
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 +-
Expand All @@ -88,7 +95,7 @@ class UpgradeCommand extends FlutterCommand {
// create mode 100644 examples/flutter_gallery/lib/gallery/demo.dart
static final RegExp _gitChangedRegex = new RegExp(r' (rename|delete mode|create mode) .+');

// Public for testing.
@visibleForTesting
static bool matchesGitLine(String line) {
return _gitDiffRegex.hasMatch(line)
|| _gitChangedRegex.hasMatch(line)
Expand Down

0 comments on commit 3001b33

Please sign in to comment.