Unverified Commit 7fb1797f authored by Benoit Gaussen's avatar Benoit Gaussen Committed by GitHub

Create a "current" symlink to artifact dir in DataDir (#1786)

* Create a current symlink to artifact dir in DataDir * Rename symlink to previous instead of current.prev... Co-authored-by: 's avatarGaussen Benoît <benoit.gaussen@orange.com>
parent da3e26a6
...@@ -141,5 +141,16 @@ func extract(dataDir string) (string, error) { ...@@ -141,5 +141,16 @@ func extract(dataDir string) (string, error) {
return "", err return "", err
} }
currentSymLink := filepath.Join(dataDir, "data", "current")
previousSymLink := filepath.Join(dataDir, "data", "previous")
if _, err := os.Lstat(currentSymLink); err == nil {
if err := os.Rename(currentSymLink, previousSymLink); err != nil {
return "", err
}
}
if err := os.Symlink(dir, currentSymLink); err != nil {
return "", err
}
return dir, os.Rename(tempDest, dir) return dir, os.Rename(tempDest, dir)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment