Commit 4bdc2b87 authored by Devon Carew's avatar Devon Carew

adjust upgrade command

parent a003d171
...@@ -141,6 +141,6 @@ String _doctorText() { ...@@ -141,6 +141,6 @@ String _doctorText() {
return logger.statusText; return logger.statusText;
} catch (error, trace) { } catch (error, trace) {
return 'encountered exception: $error\n$trace'; return 'encountered exception: $error\n\n```\n${trace.toString().trim()}\n```\n';
} }
} }
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async'; import 'dart:async';
import 'dart:io';
import '../artifacts.dart'; import '../artifacts.dart';
import '../base/process.dart'; import '../base/process.dart';
import '../dart/pub.dart';
import '../globals.dart'; import '../globals.dart';
import '../runner/flutter_command.dart'; import '../runner/flutter_command.dart';
import '../runner/version.dart'; import '../runner/version.dart';
...@@ -44,18 +46,21 @@ class UpgradeCommand extends FlutterCommand { ...@@ -44,18 +46,21 @@ class UpgradeCommand extends FlutterCommand {
return code; return code;
// Causes us to update our locally cached packages. // Causes us to update our locally cached packages.
printStatus('');
code = await runCommandAndStreamOutput(<String>[ code = await runCommandAndStreamOutput(<String>[
'bin/flutter', '--version' 'bin/flutter', '--version'
], workingDirectory: ArtifactStore.flutterRoot); ], workingDirectory: ArtifactStore.flutterRoot);
printStatus('');
code = await runCommandAndStreamOutput([sdkBinaryName('pub'), 'upgrade']);
if (code != 0) if (code != 0)
return code; return code;
printStatus(''); if (FileSystemEntity.isFileSync('pubspec.yaml')) {
printStatus(FlutterVersion.getVersion(ArtifactStore.flutterRoot).toString()); printStatus('');
code = await pubGet(upgrade: true, checkLastModified: false);
if (code != 0)
return code;
}
return 0; return 0;
} }
......
...@@ -33,11 +33,11 @@ const String _kFontSetMaterial = 'material'; ...@@ -33,11 +33,11 @@ const String _kFontSetMaterial = 'material';
const String _kFontSetRoboto = 'roboto'; const String _kFontSetRoboto = 'roboto';
class _Asset { class _Asset {
_Asset({ this.source, this.base, this.key });
final String source; final String source;
final String base; final String base;
final String key; final String key;
_Asset({ this.source, this.base, this.key });
} }
Map<String, dynamic> _readMaterialFontsManifest() { Map<String, dynamic> _readMaterialFontsManifest() {
...@@ -196,11 +196,11 @@ Future<String> buildFlx( ...@@ -196,11 +196,11 @@ Future<String> buildFlx(
/// The result from [buildInTempDir]. Note that this object should be disposed after use. /// The result from [buildInTempDir]. Note that this object should be disposed after use.
class DirectoryResult { class DirectoryResult {
DirectoryResult(this.directory, this.localBundlePath);
final Directory directory; final Directory directory;
final String localBundlePath; final String localBundlePath;
DirectoryResult(this.directory, this.localBundlePath);
/// Call this to delete the temporary directory. /// Call this to delete the temporary directory.
void dispose() { void dispose() {
directory.deleteSync(recursive: true); directory.deleteSync(recursive: true);
......
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