mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-10 23:20:57 +00:00
fix for hidden files without an extension as tombs
fix #147 introducing an extra check on TOMBNAME that, if returned empty by the first transormation that removes the last .extension, then is filled with the full TOMBFILE name without any transformation
This commit is contained in:
parent
c8616787f7
commit
3b1759b2b3
9
tomb
9
tomb
@ -244,8 +244,13 @@ _plot() {
|
|||||||
# The tomb name is TOMBFILE without an extension and underscores instead of spaces (for mount and cryptsetup)
|
# The tomb name is TOMBFILE without an extension and underscores instead of spaces (for mount and cryptsetup)
|
||||||
# It can start with dots: ..foo bar baz.tomb -> ..foo_bar_baz
|
# It can start with dots: ..foo bar baz.tomb -> ..foo_bar_baz
|
||||||
TOMBNAME=${${TOMBFILE// /_}%.*}
|
TOMBNAME=${${TOMBFILE// /_}%.*}
|
||||||
[[ -z $TOMBNAME ]] && {
|
# use the entire filename if the previous transformation returns
|
||||||
_failure "Tomb won't work without a TOMBNAME." }
|
# an empty string. This handles the corner case of tomb being
|
||||||
|
# hidden files (starting with a dot) and have no extension (only
|
||||||
|
# one dot in string)
|
||||||
|
TOMBNAME=${TOMBNAME:-${TOMBFILE}}
|
||||||
|
[[ "$TOMBNAME" = "" ]] &&
|
||||||
|
_failure "Tomb won't work without a TOMBNAME."
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user