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

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

Issue 1413713010: Fix error detection for a non-existent global script. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Fix test Created 5 years, 1 month 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/entrypoint.dart ('k') | lib/src/global_packages.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.executable; 5 library pub.executable;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:barback/barback.dart'; 10 import 'package:barback/barback.dart';
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 var vmArgs = []; 98 var vmArgs = [];
99 99
100 // Run in checked mode. 100 // Run in checked mode.
101 if (checked) vmArgs.add("--checked"); 101 if (checked) vmArgs.add("--checked");
102 102
103 var executableUrl = await _executableUrl( 103 var executableUrl = await _executableUrl(
104 entrypoint, package, executable, isGlobal: isGlobal, mode: mode); 104 entrypoint, package, executable, isGlobal: isGlobal, mode: mode);
105 105
106 if (executableUrl == null) { 106 if (executableUrl == null) {
107 var message = "Could not find ${log.bold(executable)}"; 107 var message = "Could not find ${log.bold(executable)}";
108 if (package != entrypoint.root.name) { 108 if (isGlobal || package != entrypoint.root.name) {
109 message += " in package ${log.bold(package)}"; 109 message += " in package ${log.bold(package)}";
110 } 110 }
111 log.error("$message."); 111 log.error("$message.");
112 return exit_codes.NO_INPUT; 112 return exit_codes.NO_INPUT;
113 } 113 }
114 114
115 // If we're running an executable directly from the filesystem, make sure that 115 // If we're running an executable directly from the filesystem, make sure that
116 // it knows where to load the packages. If it's a dependency's executable, for 116 // it knows where to load the packages. If it's a dependency's executable, for
117 // example, it may not have the right packages directory itself. 117 // example, it may not have the right packages directory itself.
118 // 118 //
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 Future<int> _runCachedExecutable(Entrypoint entrypoint, String snapshotPath, 284 Future<int> _runCachedExecutable(Entrypoint entrypoint, String snapshotPath,
285 List<String> args, {bool checked: false}) { 285 List<String> args, {bool checked: false}) {
286 return runSnapshot(snapshotPath, args, 286 return runSnapshot(snapshotPath, args,
287 packagesFile: entrypoint.packagesFile, 287 packagesFile: entrypoint.packagesFile,
288 checked: checked, 288 checked: checked,
289 recompile: () { 289 recompile: () {
290 log.fine("Precompiled executable is out of date."); 290 log.fine("Precompiled executable is out of date.");
291 return entrypoint.precompileExecutables(); 291 return entrypoint.precompileExecutables();
292 }); 292 });
293 } 293 }
OLDNEW
« no previous file with comments | « lib/src/entrypoint.dart ('k') | lib/src/global_packages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698