Last active
December 1, 2015 09:36
-
-
Save famousgarkin/dfe52d8bbd96381a5386 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grunt.registerTask('do', function () { | |
grunt.file.expand(['data/triggers/*.json']).forEach(function (file) { | |
var locale = path.basename(file, '.json'); | |
var localeData = {}; | |
JSON.parse(grunt.file.read(file)).records.forEach(function (trigger, i) { | |
localeData[['visit1', 'visit2', 'busy'][i]] = { | |
name: trigger.name, | |
description: trigger.description, | |
message: JSON.parse(trigger.source).actions[0].message | |
}; | |
}); | |
grunt.file.write('locale/triggers/' + locale + '.json', JSON.stringify(localeData, null, '\t')) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment