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

adjust upgrade command

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