From 98804b3aa562b20e2d452bb4d4d19032fbd0a3db Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Tue, 11 Mar 2025 09:09:55 -0400 Subject: [PATCH] feat: Adds new-proposal function --- zsh/config/functions/new-proposal | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 zsh/config/functions/new-proposal diff --git a/zsh/config/functions/new-proposal b/zsh/config/functions/new-proposal new file mode 100755 index 0000000..4606e00 --- /dev/null +++ b/zsh/config/functions/new-proposal @@ -0,0 +1,13 @@ +#!/bin/zsh + +prefix=$(date '+%y.%m.%d') +name=$(gum input --placeholder="Enter customer name...") + +if [ -z "$name" ]; then + echo "Name should not be blank." && exit 1 +fi + +cleanedName="${name%% *}${name##* }" +directory="$PROPOSALS/$prefix.$cleanedName" +mkdir "$directory" +echo "$directory"