Skip to content

Commit

Permalink
Merge pull request #24 from Workiva/use_dart_commands
Browse files Browse the repository at this point in the history
Use dart pub instead of just pub
  • Loading branch information
rmconsole7-wk authored Nov 11, 2022
2 parents 6b33930 + 8c55ef0 commit 161259b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 56 deletions.
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The latest release of `webdev_proxy` requires the following:
installed as a package dependency.

```bash
$ pub global activate webdev_proxy
$ dart pub global activate webdev_proxy
```

Learn more about activating and using packages [here][pub-global].
Expand Down
8 changes: 4 additions & 4 deletions lib/src/webdev_proc_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ ProcessResult cachedWebdevVersionResult;
/// activated, or `null` if it is not activated.
Version getGlobalWebdevVersion() {
cachedWebdevVersionResult ??= Process.runSync(
'pub',
['global', 'run', 'webdev', '--version'],
'dart',
['pub', 'global', 'run', 'webdev', '--version'],
stdoutEncoding: utf8,
);
if (cachedWebdevVersionResult.exitCode != 0) {
Expand All @@ -53,8 +53,8 @@ Future<int> printWebdevServeHelp() async {
'====================\n'),
);
final process = await Process.start(
'pub',
['global', 'run', 'webdev', 'help', 'serve'],
'dart',
['pub', 'global', 'run', 'webdev', 'help', 'serve'],
mode: ProcessStartMode.inheritStdio,
);
return process.exitCode;
Expand Down
6 changes: 3 additions & 3 deletions lib/src/webdev_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class WebdevServer {
/// Starts a `webdev serve` process with the given [args] and returns a
/// [WebdevServer] abstraction over said process.
static Future<WebdevServer> start(List<String> args) async {
final webdevArgs = ['global', 'run', 'webdev', 'serve', ...args];
log.fine('Running `pub ${webdevArgs.join(' ')}');
final webdevArgs = ['pub', 'global', 'run', 'webdev', 'serve', ...args];
log.fine('Running `dart ${webdevArgs.join(' ')}');
final process = await Process.start(
'pub',
'dart',
webdevArgs,
mode: ProcessStartMode.inheritStdio,
);
Expand Down
12 changes: 6 additions & 6 deletions test/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import 'package:test/test.dart';

Future<Null> activateWebdev(String constraint) async {
final process = await Process.start(
'pub',
['global', 'activate', 'webdev', constraint],
'dart',
['pub', 'global', 'activate', 'webdev', constraint],
mode: ProcessStartMode.inheritStdio,
);
expect(await process.exitCode, 0,
Expand All @@ -34,8 +34,8 @@ Future<Null> deactivateWebdev() async {
return;
}
final process = await Process.start(
'pub',
['global', 'deactivate', 'webdev'],
'dart',
['pub', 'global', 'deactivate', 'webdev'],
mode: ProcessStartMode.inheritStdio,
);
expect(await process.exitCode, 0,
Expand All @@ -48,8 +48,8 @@ final webdevGlobalPattern = RegExp(r'webdev [\d.]+');

bool isWebdevGlobalActivated() {
final procResult = Process.runSync(
'pub',
['global', 'list'],
'dart',
['pub', 'global', 'list'],
stdoutEncoding: utf8,
);
return procResult.stdout
Expand Down

0 comments on commit 161259b

Please sign in to comment.