feat: update create-prompt to accept title as argument and add new prompt file
- Modified create-prompt to accept title as command-line argument instead of interactive input - Added usage message when title is missing - Fixed numeric comparison in prompt numbering logic to handle leading zeros correctly - Added new prompt file 09_add-cluster-and-partner-list-view-to-website-kubectl.md - Changed task.template permissions from executable to readable (755 → 644)
This commit is contained in:
3 files changed
+29
-7
No files matched your search
+6
-7
@@ -1,12 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
create-prompt() {
|
||||
local title
|
||||
echo "Enter the title of the prompt:"
|
||||
read -r title
|
||||
|
||||
local title="$1"
|
||||
|
||||
if [[ -z "$title" ]]; then
|
||||
echo "Error: Title cannot be empty."
|
||||
echo "Usage: task create-prompt <title>"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -21,12 +20,12 @@ create-prompt() {
|
||||
local num=${file#"$prompts_dir"/}
|
||||
num=${num%%_*}
|
||||
num=${num//[!0-9]/}
|
||||
if (( num > highest_num )); then
|
||||
highest_num=num
|
||||
if [[ -n "$num" ]] && (( 10#$num > highest_num )); then
|
||||
highest_num=$((10#$num))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
local next_num=$((highest_num + 1))
|
||||
local padded_num=$(printf "%02d" "$next_num")
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: Add cluster and partner list view to website kubectl
|
||||
---
|
||||
|
||||
# Run 09
|
||||
|
||||
Replace the `==` marked instructions in this file while you work on the task.
|
||||
|
||||
## Context
|
||||
|
||||
Read the `AGENTS.md` and `README.md` to get understanding of the project.
|
||||
|
||||
## Task
|
||||
|
||||
==Specifiy the task and goals here==
|
||||
|
||||
## Worklog
|
||||
|
||||
==Agent: Fill this in as you work on the task==
|
||||
|
||||
## Summary
|
||||
|
||||
==Fill this once you completed the task==
|
||||
Executable → Regular
File mode changed.
Reference in new issue
Block a user