Skip to content

Commit

Permalink
Added filter for file names ending with .groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
fulminazzo committed Apr 14, 2024
1 parent f47e3d3 commit 9ee1119
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/src/main/groovy/it/angrybear/yagl/YAGL.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class YAGL extends JavaPlugin {
if (!commandsDir.exists()) saveDefaultCommands(commandsDir)
File[] files = commandsDir.listFiles()
if (files != null)
this.commands.addAll(files.collect { new ShellCommand(it) })
this.commands.addAll(files.findAll({ it.name.endsWith(".groovy") }).collect { new ShellCommand(it) })

commandMap().ifPresent { map -> this.commands.each { map.register(getName(), it) } }
}
Expand Down

0 comments on commit 9ee1119

Please sign in to comment.