Skip to content

Commit 6507dc2

Browse files
committed
Merge pull request ajaxorg#1149 from mikelehen/master
Autodetect workers during build instead of hardcoding them.
2 parents 319fdae + bbe2624 commit 6507dc2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Makefile.dryice.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ function jsFileList(path, filter) {
241241
}).filter(function(x){ return !!x });
242242
}
243243

244+
function workers(path) {
245+
return jsFileList(path).map(function(x) {
246+
if (x.slice(-7) == "_worker")
247+
return x.slice(0, -7);
248+
}).filter(function(x) { return !!x; });
249+
}
250+
244251
function addSuffix(options) {
245252
if (options.suffix == null) {
246253
options.suffix = "";
@@ -298,7 +305,7 @@ var buildAce = function(options) {
298305
modes: jsFileList("lib/ace/mode", /_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/),
299306
themes: jsFileList("lib/ace/theme"),
300307
extensions: jsFileList("lib/ace/ext"),
301-
workers: ["javascript", "coffee", "css", "json", "xquery"],
308+
workers: workers("lib/ace/mode"),
302309
keybindings: ["vim", "emacs"]
303310
};
304311

0 commit comments

Comments
 (0)