refactor(file-transfer): replace base64 encoding with direct file transfer method in various components for improved clarity and efficiency

This commit is contained in:
Andras Bacsai
2025-09-09 11:10:38 +02:00
parent fe2c4fd1c7
commit feacedbb04
8 changed files with 36 additions and 51 deletions

View File

@@ -159,8 +159,7 @@ class LocalFileVolume extends BaseModel
$chmod = data_get($this, 'chmod');
$chown = data_get($this, 'chown');
if ($content) {
$content = base64_encode($content);
$commands->push("echo '$content' | base64 -d | tee $path > /dev/null");
transfer_file_to_server($content, $path, $server);
} else {
$commands->push("touch $path");
}
@@ -175,7 +174,9 @@ class LocalFileVolume extends BaseModel
$commands->push("mkdir -p $path > /dev/null 2>&1 || true");
}
return instant_remote_process($commands, $server);
if ($commands->count() > 0) {
return instant_remote_process($commands, $server);
}
}
// Accessor for convenient access