Skip to content

Commit

Permalink
fix: UUID display
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko committed Jul 2, 2024
1 parent 92585ac commit ec51ee5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mkfstab.nim
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ proc mkfstab(root: seq[string], output = "", includepseudo = false, verbosity =
# turn into UUID=
for (_, uuid) in walkDir(Path("/dev/disk/by-uuid"), checkDir=true):
var dev = absolutePath(expandSymlink(uuid), "/dev/disk/by-uuid".Path)
debug &"Found {uuid.string:<54}{dev.string}"
var uuid = uuid.string
uuid.removePrefix "/dev/disk/by-uuid/"
debug &"Found {uuid:<36}{dev.string}"
for i, mp in enumerate(mps):
if mp.device.Path == dev:
mps[i].device = fmt"UUID={uuid.string}"
mps[i].device = fmt"UUID={uuid}"
# check lengths for pretty fstab
for mp in mps:
lengths = [
Expand Down

0 comments on commit ec51ee5

Please sign in to comment.