From 8c55ef00fc0901735d9a3f79e66dcfaec4445bf4 Mon Sep 17 00:00:00 2001 From: Rob Becker Date: Fri, 11 Nov 2022 11:47:32 -0700 Subject: [PATCH] Stop using pub command --- .travis.yml | 42 ---------------------------------- README.md | 2 +- lib/src/webdev_proc_utils.dart | 8 +++---- lib/src/webdev_server.dart | 6 ++--- test/util.dart | 12 +++++----- 5 files changed, 14 insertions(+), 56 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3afad15..0000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: dart - -# This is necessary to use proper Chrome. Travis's version of chromium is from -# 2014. -sudo: required -dist: trusty -addons: - chrome: stable - apt: - sources: - - google-chrome - packages: - - google-chrome-stable - -dart: - - 2.3.2 - - stable - - dev - -with_content_shell: false - -before_install: - - export CHROMEDRIVER_BINARY=/usr/bin/google-chrome - - export CHROMEDRIVER_ARGS=--no-sandbox - - /usr/bin/google-chrome --version - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - -before_script: - - wget http://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip - - unzip chromedriver_linux64.zip - - export PATH=$PATH:$PWD - - pub get - -script: - - dartanalyzer . - - dartfmt -n --set-exit-if-changed . - - pub run test - -cache: - directories: - - $HOME/.pub-cache \ No newline at end of file diff --git a/README.md b/README.md index 5a6c53f..2896adf 100644 --- a/README.md +++ b/README.md @@ -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]. diff --git a/lib/src/webdev_proc_utils.dart b/lib/src/webdev_proc_utils.dart index 5840708..d521a26 100644 --- a/lib/src/webdev_proc_utils.dart +++ b/lib/src/webdev_proc_utils.dart @@ -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) { @@ -53,8 +53,8 @@ Future 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; diff --git a/lib/src/webdev_server.dart b/lib/src/webdev_server.dart index b08aa56..bbb2d0c 100644 --- a/lib/src/webdev_server.dart +++ b/lib/src/webdev_server.dart @@ -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 start(List 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, ); diff --git a/test/util.dart b/test/util.dart index 87f465f..dfc8561 100644 --- a/test/util.dart +++ b/test/util.dart @@ -19,8 +19,8 @@ import 'package:test/test.dart'; Future 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, @@ -34,8 +34,8 @@ Future 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, @@ -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