this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

zsh: task function

+33
+33
zsh/zshrc
··· 15 15 16 16 export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH" 17 17 export PATH="$HOME/.local/bin:$PATH" 18 + 19 + # Task management 20 + task() { 21 + # Check if .tasks/ folder exists 22 + if [[ ! -d ".tasks" ]]; then 23 + echo "Error: .tasks/ folder not found in current directory" >&2 24 + return 1 25 + fi 26 + 27 + # Check if task name was provided 28 + if [[ -z "$1" ]]; then 29 + echo "Usage: task <task-name>" >&2 30 + return 1 31 + fi 32 + 33 + # Generate short timestamp (YYMMDDHHMM format) 34 + local timestamp=$(date +"%y%m%d%H%M") 35 + 36 + # Convert task name to hyphenated format (replace spaces with hyphens, lowercase) 37 + local task_name=$(echo "$*" | tr '[:upper:]' '[:lower:]' | tr ' ' '-') 38 + 39 + # Create folder name 40 + local folder_name=".tasks/${timestamp}-${task_name}" 41 + 42 + # Create the directory 43 + mkdir -p "$folder_name" 44 + 45 + # Create TASK.md file 46 + touch "$folder_name/TASK.md" 47 + 48 + # Echo the path for piping 49 + echo "$folder_name/TASK.md" 50 + }