From 27e7295ca76111c00bcf83327b0a151f21c23743 Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Mon, 21 Nov 2022 03:06:15 -0800 Subject: [PATCH] Abort pod install if bad HERMES_ENGINE_TARBALL_PATH is set Summary: Changelog: [iOS][Changed] - Abort pod install if bad HERMES_ENGINE_TARBALL_PATH is set. Reviewed By: cipolleschi Differential Revision: D41341471 fbshipit-source-id: 34a3ac154b0a3f795d07dcd10f92361cb9bb4ad6 --- sdks/hermes-engine/hermes-engine.podspec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdks/hermes-engine/hermes-engine.podspec b/sdks/hermes-engine/hermes-engine.podspec index 8ce5017049f906..47973a6f7f4943 100644 --- a/sdks/hermes-engine/hermes-engine.podspec +++ b/sdks/hermes-engine/hermes-engine.podspec @@ -26,7 +26,13 @@ isInMain = version.include?('1000.0.0') isNightly = version.start_with?('0.0.0-') if ENV.has_key?('HERMES_ENGINE_TARBALL_PATH') - Pod::UI.puts '[Hermes] Using pre-built Hermes binaries from local path.' if Object.const_defined?("Pod::UI") + if !File.exist?(ENV['HERMES_ENGINE_TARBALL_PATH']) + abort "[Hermes] HERMES_ENGINE_TARBALL_PATH is set, but points to a non-existing file: \"#{ENV['HERMES_ENGINE_TARBALL_PATH']}\"\nIf you don't want to use tarball, run `unset HERMES_ENGINE_TARBALL_PATH`" + end +end + +if ENV.has_key?('HERMES_ENGINE_TARBALL_PATH') + Pod::UI.puts "[Hermes] Using pre-built Hermes binaries from local path: #{ENV['HERMES_ENGINE_TARBALL_PATH']}".yellow if Object.const_defined?("Pod::UI") source[:http] = "file://#{ENV['HERMES_ENGINE_TARBALL_PATH']}" elsif isInMain Pod::UI.puts '[Hermes] Installing hermes-engine may take slightly longer, building Hermes compiler from source...'.yellow if Object.const_defined?("Pod::UI")