feat: Edit singleton config file directly if no other file is found

This commit is contained in:
2026-06-20 09:47:19 +05:30
parent 1cae621151
commit 24f5f88069

View File

@@ -34,7 +34,13 @@ if [ -n "$config_dir" ] && [ -d "$config_dir" ]; then
if [ $# -gt 0 ]; then
"$editor" "$@"
else
"$editor" .
# Check if there is exactly one file in the config directory
files=( * )
if [ ${#files[@]} -eq 1 ] && [ -f "${files[0]}" ]; then
"$editor" "${files[0]}"
else
"$editor" .
fi
fi
)
else