Skip to content

Commit 23c0d6f

Browse files
committed
simplify deployBinary a little bit
1 parent 8e4d4b7 commit 23c0d6f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ public function deployBinary(string $src, string $dst, bool $executable = true):
128128
{
129129
logger()->debug('Deploying binary from ' . $src . ' to ' . $dst);
130130

131-
// UPX for linux
132-
$upx_option = (bool) $this->getOption('with-upx-pack', false);
133-
134131
// file must exists
135132
if (!file_exists($src)) {
136133
throw new SPCInternalException("Deploy failed. Cannot find file: {$src}");
@@ -152,13 +149,14 @@ public function deployBinary(string $src, string $dst, bool $executable = true):
152149
$this->extractDebugInfo($dst);
153150

154151
// strip
155-
if (!$this->getOption('no-strip', false)) {
152+
if (!$this->getOption('no-strip')) {
156153
$this->stripBinary($dst);
157154
}
158155

159-
// Compress binary with UPX if needed (only for Linux)
156+
// UPX for linux
157+
$upx_option = $this->getOption('with-upx-pack');
160158
if ($upx_option && PHP_OS_FAMILY === 'Linux' && $executable) {
161-
if ($this->getOption('no-strip', false)) {
159+
if ($this->getOption('no-strip')) {
162160
logger()->warning('UPX compression is not recommended when --no-strip is enabled.');
163161
}
164162
logger()->info("Compressing {$dst} with UPX");

0 commit comments

Comments
 (0)