Skip to content

Commit

Permalink
version v0.24.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cuhsat committed Jun 8, 2024
1 parent 7410865 commit 40dfa95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/fmount/fmount.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,18 @@ func CreateImageMount(img, mnt string) error {
func CreateImageSymlink(img, dev string) (err error) {
dir := filepath.Join(SymlinkPath, filepath.Base(img))

if _, err = os.Stat(dir); !os.IsNotExist(err) {
if err = os.RemoveAll(dir); err != nil {
sys.Error(err)
}
}

if err = os.MkdirAll(dir, sys.MODE_DIR); err != nil {
return
}

lnk := filepath.Join(dir, filepath.Base(dev))

// TODO: remove symlink if exists?

return os.Symlink(dev, lnk)
}

Expand Down

0 comments on commit 40dfa95

Please sign in to comment.