commit 29a2b65
hovercats
·
2023-11-22 10:56:43 +0000 UTC
parent d6aac6a
bmks: use if instead of test twice in add func. this also breaks up the rather long line, so it should more readable
1 files changed,
+5,
-2
M
sh/bmks
M
sh/bmks
+5,
-2
1@@ -14,8 +14,11 @@ add() {
2 [ -z "${url}" ] && printf "Error: url must be provided\n"; exit 1
3 printf "Description: "
4 read -r description
5- [ -z "${description}" ] && printf "%s\n" "${url}" >> "${bookmarks}"
6- [ -n "${description}" ] && printf "%s\n" "${description} - ${url}" >> "${bookmarks}"
7+ if [ -z "${description}" ]; then
8+ printf "%s\n" "${url}" >> "${bookmarks}"
9+ else
10+ printf "%s\n" "${description} - ${url}" >> "${bookmarks}"
11+ fi
12 }
13
14 list() {