diff --git a/bin/commit-git-folder b/bin/commit-git-folder index 1e8b415..4016997 100755 --- a/bin/commit-git-folder +++ b/bin/commit-git-folder @@ -1,8 +1,8 @@ #!/usr/bin/env bash commit-git-folder() { - if [[ -z "$1" ]]; then echo "\$1 is empty."; exit; fi - if [[ -z "$2" ]]; then echo "\$2 is empty."; exit; fi + if [[ -z "$1" ]]; then echo "\$1/path is empty."; exit; fi + if [[ -z "$2" ]]; then echo "\$2/message is empty."; exit; fi local git_folders=$(ls-git-folder "$1") for git_folder in $git_folders; do diff --git a/prompts/14_add-var-name-to-is-empty-checks.md b/prompts/14_add-var-name-to-is-empty-checks.md new file mode 100644 index 0000000..bafc365 --- /dev/null +++ b/prompts/14_add-var-name-to-is-empty-checks.md @@ -0,0 +1,58 @@ +--- +title: Add var name to is empty checks +--- + +# Run 14 + +Note: @Agent refers to the AI agent (you) who is working on this task. + +@Agent when working on this task, make sure to: + +- Read context and task section first +- Prepare a list of todos +- Update the todo list while working on the task + +## Context + +Read the `AGENTS.md` and `README.md` to get an understanding of the project. + +## Task + +In the `bin` folder are functions with checks like this: + +``` + if [[ -z "$1" ]]; then + echo '$1 is empty.' + exit + fi +``` + +The checks work, but it is unclear what the name of the variable is. + +Some functions have been fixed: + +``` +commit-git-folder() { + if [[ -z "$1" ]]; then echo "\$1/path is empty."; exit; fi + if [[ -z "$2" ]]; then echo "\$2/message is empty."; exit; fi +``` + +The names of the variables also match the help rows definition of `task.template` file: + +``` +rows+=("commit-git-folder|[message][path]|Commit all changes in git folders in path.") +``` + +The same help definition can also be found in the `library.md`. + +Do not script this process. Check every function of every file in the `bin` folder and update according to the help row. + +Some variables are optional, this is not mentioned explicitly. Upate the help row to tell if the variable is optional or not. + +Here is an example: + +``` +rows+=("get-modules|[option]|Get list of modules in path. 'basename' or 'dirname'.") +``` + +After every change execute the `task` script to check that the scripts still work. \ No newline at end of file