From 147511fd2dfbb76f65272b2e0f74dab959a04fb7 Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Thu, 29 Jul 2021 13:02:03 +0200 Subject: [PATCH 1/2] Allow passing options without being a real file By removing the `is_file` check we allow installing extensions like this: ```bash bin/pickle install --source --with-configure-options <(echo --with-rdkafka=/opt/homebrew/opt/librdkafka) rdkafka ``` No more need to create a file with the options first. --- src/Base/Abstracts/Console/Command/BuildCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base/Abstracts/Console/Command/BuildCommand.php b/src/Base/Abstracts/Console/Command/BuildCommand.php index 54e8aeec..d91a570e 100644 --- a/src/Base/Abstracts/Console/Command/BuildCommand.php +++ b/src/Base/Abstracts/Console/Command/BuildCommand.php @@ -101,7 +101,7 @@ protected function buildOptions(Package $package, InputInterface $input, OutputI $force_opts = $input->getOption('with-configure-options'); if ($force_opts) { - if (!file_exists($force_opts) || !is_file($force_opts) || !is_readable($force_opts)) { + if (!file_exists($force_opts) || !is_readable($force_opts)) { throw new Exception("File '{$force_opts}' is unusable"); } From 2b86c75cf2282b3e7f439ab9232beaba9b066722 Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Tue, 17 Aug 2021 12:01:37 +0200 Subject: [PATCH 2/2] Apply feedback --- src/Base/Abstracts/Console/Command/BuildCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base/Abstracts/Console/Command/BuildCommand.php b/src/Base/Abstracts/Console/Command/BuildCommand.php index d91a570e..29eb87f3 100644 --- a/src/Base/Abstracts/Console/Command/BuildCommand.php +++ b/src/Base/Abstracts/Console/Command/BuildCommand.php @@ -101,7 +101,7 @@ protected function buildOptions(Package $package, InputInterface $input, OutputI $force_opts = $input->getOption('with-configure-options'); if ($force_opts) { - if (!file_exists($force_opts) || !is_readable($force_opts)) { + if (!file_exists($force_opts) || !(is_file($force_opts) || is_link($force_opts)) || !is_readable($force_opts)) { throw new Exception("File '{$force_opts}' is unusable"); }