mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-04-08 09:54:35 +00:00
fix symlink directory not existing
This commit is contained in:
parent
6b259336bd
commit
b94c6edbb8
1 changed files with 4 additions and 0 deletions
|
@ -539,6 +539,10 @@ func (app *appContext) validateManifest() error {
|
|||
}
|
||||
|
||||
func atomicSymlink(oldname, newname string) error {
|
||||
if err := os.MkdirAll(filepath.Dir(newname), 0o755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Fast path: if newname does not exist yet, we can skip the whole dance
|
||||
// below.
|
||||
if err := os.Symlink(oldname, newname); err == nil || !os.IsExist(err) {
|
||||
|
|
Loading…
Add table
Reference in a new issue