From 0ae738b581fc2473b4a137cc3102023565a85d76 Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Fri, 21 Apr 2023 12:49:23 -0500 Subject: [PATCH] chore(shorebird_cli): remove unnecessary trailing `/` from storage url (#343) --- .../shorebird_cli/lib/src/shorebird_process.dart | 2 +- .../test/src/shorebird_process_test.dart | 14 +++++++------- third_party/flutter/bin/internal/shared.sh | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/shorebird_cli/lib/src/shorebird_process.dart b/packages/shorebird_cli/lib/src/shorebird_process.dart index 4aa9b95f..c06501df 100644 --- a/packages/shorebird_cli/lib/src/shorebird_process.dart +++ b/packages/shorebird_cli/lib/src/shorebird_process.dart @@ -106,7 +106,7 @@ class ShorebirdProcess { if (executable == 'flutter') { // If this ever changes we also need to update the `shorebird` shell // wrapper which downloads runs Flutter to fetch artifacts the first time. - return {'FLUTTER_STORAGE_BASE_URL': 'https://download.shorebird.dev/'}; + return {'FLUTTER_STORAGE_BASE_URL': 'https://download.shorebird.dev'}; } return {}; diff --git a/packages/shorebird_cli/test/src/shorebird_process_test.dart b/packages/shorebird_cli/test/src/shorebird_process_test.dart index 48ba036a..6da5fc6f 100644 --- a/packages/shorebird_cli/test/src/shorebird_process_test.dart +++ b/packages/shorebird_cli/test/src/shorebird_process_test.dart @@ -12,6 +12,10 @@ class _MockProcessWrapper extends Mock implements ProcessWrapper {} void main() { group('ShorebirdProcess', () { + const flutterStorageBaseUrlEnv = { + 'FLUTTER_STORAGE_BASE_URL': 'https://download.shorebird.dev', + }; + late ProcessWrapper processWrapper; late Process startProcess; late ProcessResult runProcessResult; @@ -79,9 +83,7 @@ void main() { any(that: contains('bin/cache/flutter/bin/flutter')), ['--version'], runInShell: true, - environment: { - 'FLUTTER_STORAGE_BASE_URL': 'https://download.shorebird.dev/', - }, + environment: flutterStorageBaseUrlEnv, workingDirectory: '~', ), ).called(1); @@ -202,9 +204,7 @@ void main() { any(that: contains('bin/cache/flutter/bin/flutter')), ['run'], runInShell: true, - environment: { - 'FLUTTER_STORAGE_BASE_URL': 'https://download.shorebird.dev/', - }, + environment: flutterStorageBaseUrlEnv, ), ).called(1); }); @@ -245,7 +245,7 @@ void main() { runInShell: true, environment: { 'ENV_VAR': 'asdfasdf', - 'FLUTTER_STORAGE_BASE_URL': 'https://download.shorebird.dev/', + ...flutterStorageBaseUrlEnv, }, ), ).called(1); diff --git a/third_party/flutter/bin/internal/shared.sh b/third_party/flutter/bin/internal/shared.sh index a9408229..88b3b158 100755 --- a/third_party/flutter/bin/internal/shared.sh +++ b/third_party/flutter/bin/internal/shared.sh @@ -20,7 +20,7 @@ function update_flutter { SHOREBIRD_ENGINE_VERSION=`cat "$FLUTTER_PATH/bin/internal/engine.version"` echo "Shorebird Engine • revision $SHOREBIRD_ENGINE_VERSION" # Install Shorebird Flutter Artifacts - FLUTTER_STORAGE_BASE_URL=https://download.shorebird.dev/ $FLUTTER_PATH/bin/flutter --version + FLUTTER_STORAGE_BASE_URL=https://download.shorebird.dev $FLUTTER_PATH/bin/flutter --version } function pub_upgrade_with_retry {