Simplify removal of trailing spaces

This commit is contained in:
Nathan Henrie 2023-01-30 14:37:15 -07:00
parent 4c315d9683
commit 4b2b6fa111

View file

@ -23,9 +23,7 @@ with lib; let
if isDarwin
then ''
if ! diskutil info "${cfg.secretsMountPoint}" &> /dev/null; then
dev=$(diskutil image attach -mountPolicy=noMount ram://1MiB)
# Remove trailing tabs
dev=''${dev%%[[:space:]]*}
dev=$(diskutil image attach -mountPolicy=noMount ram://1MiB | sed 's/[[:space:]]*$//')
newfs_hfs -v agenix "$dev"
mount -t hfs -o nobrowse,nodev,nosuid,-m=0751 "$dev" "${cfg.secretsMountPoint}"
fi