浏览代码

Check multiple possible nodes

Bob Mottram 7 年前
父节点
当前提交
c23cd4aee5
共有 1 个文件被更改,包括 13 次插入4 次删除
  1. 13
    4
      src/freedombone-utils-nodejs

+ 13
- 4
src/freedombone-utils-nodejs 查看文件

98
     fi
98
     fi
99
 
99
 
100
     $mesh_install_nodejs_prefix apt-get -yq install nodejs
100
     $mesh_install_nodejs_prefix apt-get -yq install nodejs
101
-
102
-    if [ ! -f ${rootdir}/usr/bin/nodejs ]; then
103
-        echo $'nodejs was not installed'
104
-        exit 63962
101
+    CURR_NODE_VERSION=$(node --version)
102
+    if [[ "$CURR_NODE_VERSION" != "v${NODEJS_VERSION}" ]]; then
103
+        echo $"Expected node version $NODEJS_VERSION but actually have $CURR_NODE_VERSION"
104
+        exit 5274527
105
     fi
105
     fi
106
 
106
 
107
     if [ -f $rootdir/usr/bin/nodejs ]; then
107
     if [ -f $rootdir/usr/bin/nodejs ]; then
108
         cp $rootdir/usr/bin/nodejs $rootdir/usr/bin/node
108
         cp $rootdir/usr/bin/nodejs $rootdir/usr/bin/node
109
     fi
109
     fi
110
 
110
 
111
+    if [ ! -f ${rootdir}/usr/bin/node ]; then
112
+        if [ ! -f ${rootdir}/usr/local/bin/node ]; then
113
+            if [ ! -f ${rootdir}/usr/bin/nodejs ]; then
114
+                echo $'nodejs was not installed'
115
+                exit 63962
116
+            fi
117
+        fi
118
+    fi
119
+
111
     if [ ! -f $rootdir/usr/bin/node ]; then
120
     if [ ! -f $rootdir/usr/bin/node ]; then
112
         echo $'/usr/bin/node not found'
121
         echo $'/usr/bin/node not found'
113
         exit 7235728
122
         exit 7235728