uuidgen
This commit is contained in:
10
src/main.sh
10
src/main.sh
@@ -6,12 +6,12 @@ err() {
|
||||
echo "❌ $1" >/dev/tty
|
||||
}
|
||||
# Read configuration
|
||||
# shellcheck source=/dev/null
|
||||
CONFIGFILE="$HOME/.config/fzf-vjour/config"
|
||||
if [ ! -f "$CONFIGFILE" ]; then
|
||||
err "Configuration '$CONFIGFILE' not found."
|
||||
exit 1
|
||||
fi
|
||||
# shellcheck source=/dev/null
|
||||
. "$CONFIGFILE"
|
||||
if [ -z "${ROOT:-}" ] || [ -z "${SYNC_CMD:-}" ] || [ -z "${COLLECTION_LABELS:-}" ]; then
|
||||
err "Configuration is incomplete."
|
||||
@@ -25,6 +25,12 @@ else
|
||||
err "Did not find the command-line fuzzy finder fzf."
|
||||
exit 1
|
||||
fi
|
||||
if command -v "uuidgen" >/dev/null; then
|
||||
UUIDGEN="uuidgen"
|
||||
else
|
||||
err "Did not find the uuidgen command."
|
||||
exit 1
|
||||
fi
|
||||
if command -v "bat" >/dev/null; then
|
||||
CAT="bat"
|
||||
elif command -v "batcat" >/dev/null; then
|
||||
@@ -148,7 +154,7 @@ if [ "${1:-}" = "--new" ]; then
|
||||
collection=$(echo "$COLLECTION_LABELS" | tr ';' '\n' | fzf --delimiter='=' --with-nth=2 --accept-nth=1)
|
||||
file=""
|
||||
while [ -f "$file" ] || [ -z "$file" ]; do
|
||||
uuid=$(uuidgen)
|
||||
uuid=$($UUIDGEN)
|
||||
file="$ROOT/$collection/$uuid.ics"
|
||||
done
|
||||
tmpmd=$(mktemp --suffix='.md')
|
||||
|
||||
Reference in New Issue
Block a user