Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: lib/src/global_packages.dart

Issue 1292003005: Don't crash for pre-1.12 global packages. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/executable.dart ('k') | test/global/run/runs_script_without_packages_file_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.global_packages; 5 library pub.global_packages;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:path/path.dart' as p; 10 import 'package:path/path.dart' as p;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 346
347 // Unless the user overrides the verbosity, we want to filter out the 347 // Unless the user overrides the verbosity, we want to filter out the
348 // normal pub output shown while loading the environment. 348 // normal pub output shown while loading the environment.
349 if (log.verbosity == log.Verbosity.NORMAL) { 349 if (log.verbosity == log.Verbosity.NORMAL) {
350 log.verbosity = log.Verbosity.WARNING; 350 log.verbosity = log.Verbosity.WARNING;
351 } 351 }
352 352
353 var snapshotPath = p.join(binDir, '$executable.dart.snapshot'); 353 var snapshotPath = p.join(binDir, '$executable.dart.snapshot');
354 return exe.runSnapshot(snapshotPath, args, 354 return exe.runSnapshot(snapshotPath, args,
355 checked: checked, 355 checked: checked,
356 packagesFile: _getPackagesFilePath(package),
357 recompile: () async { 356 recompile: () async {
358 log.fine("$package:$executable is out of date and needs to be " 357 log.fine("$package:$executable is out of date and needs to be "
359 "recompiled."); 358 "recompiled.");
360 await _precompileExecutables( 359 await _precompileExecutables(
361 find(package).packageGraph.entrypoint, package); 360 find(package).packageGraph.entrypoint, package);
362 }); 361 });
363 } 362 }
364 363
365 /// Gets the path to the lock file for an activated cached package with 364 /// Gets the path to the lock file for an activated cached package with
366 /// [name]. 365 /// [name].
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 } 783 }
785 784
786 /// Returns the value of the property named [name] in the bin stub script 785 /// Returns the value of the property named [name] in the bin stub script
787 /// [source]. 786 /// [source].
788 String _binStubProperty(String source, String name) { 787 String _binStubProperty(String source, String name) {
789 var pattern = new RegExp(quoteRegExp(name) + r": ([a-zA-Z0-9_-]+)"); 788 var pattern = new RegExp(quoteRegExp(name) + r": ([a-zA-Z0-9_-]+)");
790 var match = pattern.firstMatch(source); 789 var match = pattern.firstMatch(source);
791 return match == null ? null : match[1]; 790 return match == null ? null : match[1];
792 } 791 }
793 } 792 }
OLDNEW
« no previous file with comments | « lib/src/executable.dart ('k') | test/global/run/runs_script_without_packages_file_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698