Browse Source

Improve handling of npm install script

Bob Mottram 7 years ago
parent
commit
c770026d47
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      src/freedombone-utils-nodejs

+ 6
- 2
src/freedombone-utils-nodejs View File

85
         exit 7235728
85
         exit 7235728
86
     fi
86
     fi
87
 
87
 
88
-    wget https://www.npmjs.com/install.sh -O $rootdir/root/npm_install.sh
88
+    $mesh_install_nodejs_prefix wget https://www.npmjs.com/install.sh -O /root/npm_install.sh
89
     if [ ! -f $rootdir/root/npm_install.sh ]; then
89
     if [ ! -f $rootdir/root/npm_install.sh ]; then
90
         echo $'Unable to download npm installer'
90
         echo $'Unable to download npm installer'
91
         exit 8793636
91
         exit 8793636
92
     fi
92
     fi
93
+    if ! grep -q "t=\"\${npm_install}\"" $rootdir/root/npm_install.sh; then
94
+        echo $'Unable to set npm version within npm_install.sh'
95
+        exit 629052
96
+    fi
93
     $mesh_install_nodejs_prefix chmod +x /root/npm_install.sh
97
     $mesh_install_nodejs_prefix chmod +x /root/npm_install.sh
94
-    sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" $rootdir/root/npm_install.sh
98
+    $mesh_install_nodejs_prefix sed -i "s|t=\"\${npm_install}\"|t=\"$NPM_VERSION\"|g" /root/npm_install.sh
95
     $mesh_install_nodejs_prefix /root/npm_install.sh
99
     $mesh_install_nodejs_prefix /root/npm_install.sh
96
 
100
 
97
     if [ ! -f $rootdir/usr/bin/npm ]; then
101
     if [ ! -f $rootdir/usr/bin/npm ]; then