Hi everyone, I have a question. Before my project was using this implementation:
def deleteAllHiddenFiles(path : String)
begin
Dir.glob("#{path}/.*", match_hidden: true) do |file_path|
if File.file?(file_path)
deleteFile(file_path)
end
end
rescue error
Ism.notifyOfDeleteAllHiddenFilesError(path, error)
Ism.exitProgram
end
end
The compiler outputted warning about deprecated use of the Dir.glob function. I tried to update to the last way to do, but I think I didn’t use properly, because crystal complain about undefined constant DotFiles:
Dir.glob(Dir["#{path}/.*"], File::MatchOptions::DotFiles)