summaryrefslogtreecommitdiff
path: root/scripts/Util.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Util.py')
-rw-r--r--scripts/Util.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/Util.py b/scripts/Util.py
index 440fe346eb7..023cc9159cf 100644
--- a/scripts/Util.py
+++ b/scripts/Util.py
@@ -219,6 +219,8 @@ class Platform(object):
except:
self.nugetPackageCache = None
+ self._hasNodeJS = None
+
def init(self, component):
self.parseBuildVariables(component, {
"supported-platforms" : ("supportedPlatforms", lambda s : s.split(" ")),
@@ -228,6 +230,15 @@ class Platform(object):
def hasDotNet(self):
return self.nugetPackageCache != None
+ def hasNodeJS(self):
+ if self._hasNodeJS is None:
+ try:
+ run("node --version")
+ self._hasNodeJS = True
+ except:
+ self._hasNodeJS = False
+ return self._hasNodeJS
+
def parseBuildVariables(self, component, variables):
# Run make to get the values of the given variables
if os.path.exists(os.path.join(component.getSourceDir(), "Makefile")): # Top level makefile