From bbe2624e9f7adcc5db816dc36b2e12f5b285ffa2 Mon Sep 17 00:00:00 2001 From: Michael Lehenbauer Date: Mon, 10 Dec 2012 14:00:02 -0800 Subject: [PATCH] Detect workers during build instead of hardcoding them. --- Makefile.dryice.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 4f56c016..218cd7ef 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -241,6 +241,13 @@ function jsFileList(path, filter) { }).filter(function(x){ return !!x }); } +function workers(path) { + return jsFileList(path).map(function(x) { + if (x.slice(-7) == "_worker") + return x.slice(0, -7); + }).filter(function(x) { return !!x; }); +} + function addSuffix(options) { if (options.suffix == null) { options.suffix = ""; @@ -298,7 +305,7 @@ var buildAce = function(options) { modes: jsFileList("lib/ace/mode", /_highlight_rules|_test|_worker|xml_util|_outdent|behaviour/), themes: jsFileList("lib/ace/theme"), extensions: jsFileList("lib/ace/ext"), - workers: ["javascript", "coffee", "css", "json", "xquery"], + workers: workers("lib/ace/mode"), keybindings: ["vim", "emacs"] };