|
@ -24,10 +24,10 @@ module.exports = function (grunt) { |
|
|
grunt.registerTask("compile-moonscript", "compiles moonscript files to lua", function() { |
|
|
grunt.registerTask("compile-moonscript", "compiles moonscript files to lua", function() { |
|
|
grunt.file.expand({filter: 'isDirectory'}, "src/**").forEach(function (dir) { |
|
|
grunt.file.expand({filter: 'isDirectory'}, "src/**").forEach(function (dir) { |
|
|
grunt.file.expand({filter: 'isFile'}, dir + "/*.moon").forEach(function (file) { |
|
|
grunt.file.expand({filter: 'isFile'}, dir + "/*.moon").forEach(function (file) { |
|
|
const directory = file.substr(0, file.lastIndexOf('/')).replace("src/",""); |
|
|
|
|
|
|
|
|
const directory = file.substr(0, file.lastIndexOf('/') + 1).replace("src/",""); |
|
|
const file_name = file.substr(file.lastIndexOf('/') + 1); |
|
|
const file_name = file.substr(file.lastIndexOf('/') + 1); |
|
|
const file_name_sans_ext = file_name.substr(0, file_name.lastIndexOf('.')); |
|
|
const file_name_sans_ext = file_name.substr(0, file_name.lastIndexOf('.')); |
|
|
const output_path = "dist/" + directory + '/' + file_name_sans_ext + '.lua'; |
|
|
|
|
|
|
|
|
const output_path = "dist/" + directory + file_name_sans_ext + '.lua'; |
|
|
|
|
|
|
|
|
const exec_task = grunt.config.get('exec') || {}; |
|
|
const exec_task = grunt.config.get('exec') || {}; |
|
|
exec_task[file] = { |
|
|
exec_task[file] = { |
|
|