From 24f5f88069ac83ab00712b102cb900c5d44cfeb4 Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Sat, 20 Jun 2026 09:47:19 +0530 Subject: [PATCH] feat: Edit singleton config file directly if no other file is found --- commands/con.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/con.sh b/commands/con.sh index e1bfe7c..0d5e797 100644 --- a/commands/con.sh +++ b/commands/con.sh @@ -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