Closed fabianoengler closed 3 years ago
Indeed, I would have suggested to use the POSIX compatible "case" instead of an external program, and the use of a subshell is also unnecessary.
However, I solved the issue now differently by only checking for an absolute path instead of the actual presence of a directory.
This fixes #35
My solution was to simply check if
X-mount.mkdir
was used and if so don't trigger the "is not a directory" error.This patch works for me and I think it's "good enough" for such a corner case but I could envision more elaborate options, like
zram-init
handling the directory creation itself or perhaps to be more accurate explicitly check if$dir
exists and is not a directory to trigger the error and only check forX-mount.mkdir
if$dir
is really not existent.Also, using
grep
this way may no be the best portable way but I figurezram-init
will be only used on modern linux distros anyway.Thoughts?