Skip to content

Commit

Permalink
[refactor-runner-adxt-783] Undone path sanitize modifications for cop…
Browse files Browse the repository at this point in the history
…y linux file
  • Loading branch information
CelianR committed Dec 23, 2024
1 parent 924ee08 commit ea4c5e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/command/unixOSCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ func formatCommandIfNeeded(command pulumi.StringInput, sudo bool, password bool,

func (fs unixOSCommand) MoveFile(runner Runner, name string, source, destination pulumi.StringInput, sudo bool, opts ...pulumi.ResourceOption) (Command, error) {
backupPath := pulumi.Sprintf("%v.%s", destination, backupExtension)
copyCommand := pulumi.Sprintf(`cp "%v" "%v"`, source, destination)
createCommand := pulumi.Sprintf(`bash -c 'if [ -f "%v" ]; then mv -f "%v" "%v"; fi; %v'`, destination, destination, backupPath, copyCommand)
deleteCommand := pulumi.Sprintf(`bash -c 'if [ -f "%v" ]; then mv -f "%v" "%v"; else rm -f "%v"; fi'`, backupPath, backupPath, destination, destination)
copyCommand := pulumi.Sprintf(`cp '%v' '%v'`, source, destination)
createCommand := pulumi.Sprintf(`bash -c 'if [ -f '%v' ]; then mv -f '%v' '%v'; fi; %v'`, destination, destination, backupPath, copyCommand)
deleteCommand := pulumi.Sprintf(`bash -c 'if [ -f '%v' ]; then mv -f '%v' '%v'; else rm -f '%v'; fi'`, backupPath, backupPath, destination, destination)
return copyRemoteFile(runner, fmt.Sprintf("move-file-%s", name), createCommand, deleteCommand, sudo, utils.MergeOptions(opts, pulumi.ReplaceOnChanges([]string{"*"}), pulumi.DeleteBeforeReplace(true))...)
}

Expand Down

0 comments on commit ea4c5e1

Please sign in to comment.