Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
dep: Use hidden tempdir for old vendor
Browse files Browse the repository at this point in the history
While there's more work to be done in making all of this safe in the
event of a signal being sent to dep, this change at least means that if
a signal is sent during the rename and a .vendor.orig directory is left
behind, subsequent runs will treat its contents as ignored.

Fixes #1304
  • Loading branch information
sdboyer committed Oct 24, 2017
1 parent 59b9d9f commit 10f46e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion txn_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func (sw *SafeWriter) Write(root string, sm gps.SourceManager, examples bool, lo
if _, err := os.Stat(vendorbak); err == nil {
// If the adjacent dir already exists, bite the bullet and move
// to a proper tempdir.
vendorbak = filepath.Join(td, "vendor.orig")
vendorbak = filepath.Join(td, ".vendor.orig")
}

failerr = fs.RenameWithFallback(vpath, vendorbak)
Expand Down

0 comments on commit 10f46e5

Please sign in to comment.