mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Raise exception when node is not on PATH
This commit is contained in:
@@ -753,8 +753,10 @@ class Tool(Dictifiable):
|
||||
mod = __import__(module, globals(), locals(), [cls])
|
||||
self.tool_action = getattr(mod, cls)()
|
||||
if getattr(self.tool_action, "requires_js_runtime", False):
|
||||
if expressions.find_engine(self.app.config) is None:
|
||||
message = REQUIRES_JS_RUNTIME_MESSAGE % self.tool_id
|
||||
try:
|
||||
expressions.find_engine(self.app.config)
|
||||
except Exception:
|
||||
message = REQUIRES_JS_RUNTIME_MESSAGE % self.tool_id or self.tool_uuid
|
||||
raise Exception(message)
|
||||
# Tests
|
||||
self.__parse_tests(tool_source)
|
||||
|
||||
@@ -5,4 +5,6 @@ def find_engine(config):
|
||||
nodejs_path = getattr(config, "nodejs_path", None)
|
||||
if nodejs_path is None:
|
||||
nodejs_path = which("nodejs") or which("node") or None
|
||||
if nodejs_path is None:
|
||||
raise Exception("nodejs or node not found on PATH")
|
||||
return nodejs_path
|
||||
|
||||
Reference in New Issue
Block a user