refactor(file-transfer): replace base64 encoding with direct file transfer method in various components for improved clarity and efficiency
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user