Bladeren bron

Check multiple possible nodes

Bob Mottram 7 jaren geleden
bovenliggende
commit
c23cd4aee5
1 gewijzigde bestanden met toevoegingen van 13 en 4 verwijderingen
  1. 13
    4
      src/freedombone-utils-nodejs

+ 13
- 4
src/freedombone-utils-nodejs Bestand weergeven

@@ -98,16 +98,25 @@ function mesh_install_nodejs {
98 98
     fi
99 99
 
100 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 105
     fi
106 106
 
107 107
     if [ -f $rootdir/usr/bin/nodejs ]; then
108 108
         cp $rootdir/usr/bin/nodejs $rootdir/usr/bin/node
109 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 120
     if [ ! -f $rootdir/usr/bin/node ]; then
112 121
         echo $'/usr/bin/node not found'
113 122
         exit 7235728