1
0
Fork 0
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:
Jörg Thalheim 2024-04-18 14:30:16 +02:00 committed by Jörg Thalheim
parent 6b259336bd
commit b94c6edbb8

View file

@ -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) {