Fix Deployment Script on Windows Clients (#433)

* resolve issue with EOL

* Manual Run

* reverse change for manual run of tests

* remove logging
This commit is contained in:
Richard Anderson 2025-01-16 20:03:53 +00:00 committed by GitHub
parent 93a7bf9c3a
commit 5947ae80bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 4 deletions

View File

@ -12,9 +12,9 @@ class UpdateDeploymentScript
*/
public function update(Site $site, array $input): void
{
$site->deploymentScript()->update([
'content' => $input['script'],
]);
$script = $site->deploymentScript;
$script->content = $input['script'];
$script->save();
}
/**

View File

@ -15,6 +15,15 @@ class DeploymentScript extends AbstractModel
{
use HasFactory;
protected static function boot(): void
{
parent::boot();
static::saving(function ($deploymentScript) {
$deploymentScript->content = str_replace("\r\n", "\n", $deploymentScript->content);
});
}
protected $fillable = [
'site_id',
'name',

View File

@ -162,7 +162,7 @@ public function runScript(string $path, string $script, ?ServerLog $serverLog, ?
}
$command = '';
foreach ($variables as $key => $variable) {
$command .= "$key=$variable".PHP_EOL;
$command .= "$key=$variable\n";
}
$command .= $this->getScript('run-script.sh', [
'path' => $path,