-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Workiva/improvements
CP-822 CLI improvements & cleanup.
- Loading branch information
Showing
17 changed files
with
99 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
library dart_dev.src.util; | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:yaml/yaml.dart'; | ||
|
||
bool hasImmediateDependency(String packageName) { | ||
File pubspec = new File('pubspec.yaml'); | ||
Map pubspecYaml = loadYaml(pubspec.readAsStringSync()); | ||
List deps = []; | ||
if (pubspecYaml.containsKey('dependencies')) { | ||
deps.addAll((pubspecYaml['dependencies'] as Map).keys); | ||
} | ||
if (pubspecYaml.containsKey('dev_dependencies')) { | ||
deps.addAll((pubspecYaml['dev_dependencies'] as Map).keys); | ||
} | ||
return deps.contains(packageName); | ||
} | ||
|
||
String parseExecutableFromCommand(String command) { | ||
return command.split(' ').first; | ||
} | ||
|
||
List<String> parseArgsFromCommand(String command) { | ||
var parts = command.split(' '); | ||
if (parts.length <= 1) return []; | ||
return parts.getRange(1, parts.length).toList(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
library dart_dev.util; | ||
|
||
export 'package:dart_dev/src/reporter.dart' show Reporter, reporter; | ||
export 'package:dart_dev/src/task_process.dart' show TaskProcess; | ||
export 'package:dart_dev/src/util.dart' | ||
show | ||
hasImmediateDependency, | ||
parseArgsFromCommand, | ||
parseExecutableFromCommand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters