Skip to content

Commit

Permalink
Add -Force option to Move-Item command.
Browse files Browse the repository at this point in the history
If using the install.ps1 script to update an existing installation it will fail with an error like this:
"An error occurred while installing: Cannot create a file when that file already exists."

Adding -Force to the script makes the script replace the existing chezmoi.exe
  • Loading branch information
persalmi committed Mar 25, 2021
1 parent 5135e06 commit 1a2e4e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/scripts/install.ps1
Expand Up @@ -291,7 +291,7 @@ function Install-Chezmoi {
$binary = "chezmoi$($binsuffix)";
$tmp_binary = (Join-Path $tempdir $binary);

Move-Item -Path $tmp_binary -Destination $BinDir
Move-Item -Force -Path $tmp_binary -Destination $BinDir

log-info "Installed $($BinDir)/$($binary)"

Expand Down

0 comments on commit 1a2e4e9

Please sign in to comment.