How do I test whether the present working directory of Atom contains a file with a given file extension?


#1

Hi,

I would like to know how I can test in a CoffeeScript file for my hornstudio package if a file with a given file extension exists in the present folder opened in Atom. For example, I want to be able to test if any Python scripts exist (with the .py file extension) in the present working directory (PWD: i.e., the folder that Atom has opened) and execute a command if this is the case. Likewise if any C++ files (file extension: .cpp) exist in the PWD I would like to execute another command. How would I test for these file extensions?

Thanks for your time,
Brenton