From b3c33a0ca3e46e0b13775c4adc4bc9b8d1c99899 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Thu, 6 Feb 2025 16:49:12 +0800 Subject: [PATCH] feat(consolidate): add period stripping from extensions in args --- bin/consolidate | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/consolidate b/bin/consolidate index 82ac66a..35270cc 100755 --- a/bin/consolidate +++ b/bin/consolidate @@ -11,13 +11,15 @@ if [ $# -gt 0 ]; then EXTENSIONS=() for var in $@ do + # Strip the . from the given extension if user gives the extension with a period (like .md) + var=${var/"."/} EXTENSIONS+=("${var}") done else echo "0 arguments entered. Searching all files" EXTENSIONS=() fi -echo ${EXTENSIONS} +echo ${EXTENSIONS[@]} # Prepare a temporary file: # Create a temporary file that will hold patterns from the ".gitignore" file.