From 2c4eedbf8b76bb7434a4be955248014eb5dcf2ae Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Sun, 13 Aug 2023 11:00:40 +0800 Subject: [PATCH 1/4] When collection has no vars then dont try to collect them (cherry picked from commit ee7528186f69e811b1b4db8e69ea2e4ec0ea2613) --- src/Exporters/Abstract/AbstractConverter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Exporters/Abstract/AbstractConverter.php b/src/Exporters/Abstract/AbstractConverter.php index 2c7f620..b5c15c2 100644 --- a/src/Exporters/Abstract/AbstractConverter.php +++ b/src/Exporters/Abstract/AbstractConverter.php @@ -71,7 +71,7 @@ abstract class AbstractConverter implements ConverterContract */ protected function setVariables(): static { - if ($this->collection->variable) { + if (isset($this->collection?->variable)) { foreach ($this->collection->variable as $var) { $this->vars["{{{$var->key}}}"] = $var->value; } -- 2.46.GIT From fb7b4baa3256f7fc354e99b87292a5bc353ff6fa Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Sun, 13 Aug 2023 11:01:00 +0800 Subject: [PATCH 2/4] Fixed wget file format (cherry picked from commit 0febfd38aa3047555d34f7e125adb3773ee8a2da) --- src/Exporters/Wget/WgetRequest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Exporters/Wget/WgetRequest.php b/src/Exporters/Wget/WgetRequest.php index f5023fb..01ccb1d 100644 --- a/src/Exporters/Wget/WgetRequest.php +++ b/src/Exporters/Wget/WgetRequest.php @@ -53,7 +53,7 @@ class WgetRequest extends AbstractRequest $output[] = http_build_query($params); return $output; default: - return ["\t$this->body"]; + return ["\t'$this->body' \ "]; } } @@ -75,7 +75,6 @@ class WgetRequest extends AbstractRequest $this->prepareHeaders(), $this->prepareBody() ); - $output[] = rtrim(array_pop($output), '\ '); $output[] = "\t'$this->url'"; return implode(PHP_EOL, array_merge($output, [''])); } -- 2.46.GIT From 1f7816c917266bf7932ad7c8b22750a0abfeaf15 Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Sun, 13 Aug 2023 11:01:31 +0800 Subject: [PATCH 3/4] When env was no set then dont try to collect vars from it (cherry picked from commit fa8ad15fdd691fb4ea5db431062e89b512a9d526) --- src/Processor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Processor.php b/src/Processor.php index df720b4..393873b 100644 --- a/src/Processor.php +++ b/src/Processor.php @@ -229,6 +229,9 @@ class Processor */ protected function initEnv(): void { + if (!isset($this->envFile)) { + return; + } $content = file_get_contents(FileSystem::normalizePath($this->envFile)); $content = json_decode($content, flags: JSON_THROW_ON_ERROR); if (!property_exists($content, 'environment') || empty($content?->environment)) { -- 2.46.GIT From 25887a47d32c06c0a395d860944dffde3457e8af Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Sun, 13 Aug 2023 11:02:59 +0800 Subject: [PATCH 4/4] Bump version --- src/Processor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Processor.php b/src/Processor.php index 393873b..e4c251e 100644 --- a/src/Processor.php +++ b/src/Processor.php @@ -22,7 +22,7 @@ class Processor /** * Converter version */ - public const VERSION = '1.2.1'; + public const VERSION = '1.2.2'; /** * @var string[] Paths to collection files -- 2.46.GIT