This has probably answered before, but I cannot find it.
How do I count the files and directories in a directory without including subdirectories? Also, hidden files should be ignored (because this folder is a git repo).
More precisely, I need an if clause, that the current folder only has one file (namely "script.sh") and no sub-folders with the exception of .git/ .
How can I do this in Bash?
EDIT: In contrast to Recursively count specific files BASH, I want to ignore the .git folder and I do not want to count files and folders in subfolders.