Files
git.taskfile.build/bin/remove-git-folder
T
Janik von Rotz 30d8d7aa86 feat: standardize required/optional param notation and update error messages
- Updated `task`, `task.template`, and `library.md` to use angle brackets (`<param>`) for required parameters and square brackets (`[param]`) for optional ones.
- Fixed argument order mismatches in `create-symlink`, `create-symlink-files`, and `commit-git-folder` documentation.
- Removed non-existent `[path]` parameter from `merge-git-remote`.
- Standardized empty-argument error messages across `bin/*` scripts to use slash notation (e.g., `$1/path is empty.`).
- Updated prompt file `prompts/21_show-optional-and-required-params-in-task-help.md` to mark task as completed and log work.
2026-09-10 14:19:58 +02:00

26 lines
659 B
Bash
Executable File

#!/bin/bash
remove-git-folder() {
if [[ -z "$1" ]]; then echo "\$1/path is empty."; exit; fi
local git_folders=$(ls-git-folder "$1")
echo "Delete: $git_folders"
read -p "Are you sure to delete these git folder(s)? (yes/N): " confirm
if [[ "${confirm,,}" != "yes" ]]; then
echo 'Aborted.'
return 1
fi
for git_folder in $git_folders; do
echo "Remove $git_folder from .gitmodules file."
git config --file .gitmodules --remove-section "submodule.$git_folder"
echo "Delete git folder $git_folder."
rm -rf "$git_folder"
done
save-version
}
rgf() {
remove-git-folder "$@"
}