mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-07-17 06:25:16 +08: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 {
|
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
|
// Fast path: if newname does not exist yet, we can skip the whole dance
|
||||||
// below.
|
// below.
|
||||||
if err := os.Symlink(oldname, newname); err == nil || !os.IsExist(err) {
|
if err := os.Symlink(oldname, newname); err == nil || !os.IsExist(err) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue