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

Side by Side Diff: utils/pub/io.dart

Issue 10942032: Fix git on non-Windows. Fix create_sdk on machines using svn. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « tools/create_sdk.py ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * Helper functionality to make working with IO easier. 6 * Helper functionality to make working with IO easier.
7 */ 7 */
8 #library('io'); 8 #library('io');
9 9
10 #import('dart:io'); 10 #import('dart:io');
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 }); 536 });
537 return completer.future; 537 return completer.future;
538 } 538 }
539 539
540 /// Tests whether or not the git command-line app is available for use. 540 /// Tests whether or not the git command-line app is available for use.
541 Future<bool> get isGitInstalled { 541 Future<bool> get isGitInstalled {
542 if (_isGitInstalledCache != null) { 542 if (_isGitInstalledCache != null) {
543 // TODO(rnystrom): The sleep is to pump the message queue. Can use 543 // TODO(rnystrom): The sleep is to pump the message queue. Can use
544 // Future.immediate() when #3356 is fixed. 544 // Future.immediate() when #3356 is fixed.
545 return sleep(0).transform((_) => _isGitInstalledCache); 545 return sleep(0).transform((_) => _isGitInstalledCache);
546 }
546 547
547 return _gitCommand.transform((git) => git != null); 548 return _gitCommand.transform((git) => git != null);
548 }
549 } 549 }
550 550
551 /// Run a git process with [args] from [workingDir]. 551 /// Run a git process with [args] from [workingDir].
552 Future<PubProcessResult> runGit(List<String> args, [String workingDir]) => 552 Future<PubProcessResult> runGit(List<String> args, [String workingDir]) =>
553 _gitCommand.chain((git) => runProcess(git, args, workingDir)); 553 _gitCommand.chain((git) => runProcess(git, args, workingDir));
554 554
555 /// Returns the name of the git command-line app, or null if Git could not be 555 /// Returns the name of the git command-line app, or null if Git could not be
556 /// found on the user's PATH. 556 /// found on the user's PATH.
557 Future<String> get _gitCommand { 557 Future<String> get _gitCommand {
558 // TODO(nweiz): Just use Future.immediate once issue 3356 is fixed. 558 // TODO(nweiz): Just use Future.immediate once issue 3356 is fixed.
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 return new Directory(entry); 705 return new Directory(entry);
706 } 706 }
707 707
708 /** 708 /**
709 * Gets a [Uri] for [uri], which can either already be one, or be a [String]. 709 * Gets a [Uri] for [uri], which can either already be one, or be a [String].
710 */ 710 */
711 Uri _getUri(uri) { 711 Uri _getUri(uri) {
712 if (uri is Uri) return uri; 712 if (uri is Uri) return uri;
713 return new Uri.fromString(uri); 713 return new Uri.fromString(uri);
714 } 714 }
OLDNEW
« no previous file with comments | « tools/create_sdk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698