浏览代码

Check for presence of node

Bob Mottram 7 年前
父节点
当前提交
1fd767b7c3
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7
    2
      src/freedombone-image-customise

+ 7
- 2
src/freedombone-image-customise 查看文件

@@ -565,8 +565,13 @@ install_patchwork() {
565 565
     chroot "$rootdir" apt-get -yq install g++ m4 libtool automake nodejs curl
566 566
     chroot "$rootdir" apt-get -yq install libxext-dev libxtst-dev libxkbfile-dev
567 567
 
568
-    chroot "$rootdir" which node
569
-    chroot "$rootdir" which nodejs
568
+    if [ -f $rootdir/usr/bin/nodejs ]; then
569
+        cp $rootdir/usr/bin/nodejs $rootdir/usr/bin/node
570
+    fi
571
+    if [ ! -f $rootdir/usr/bin/node ]; then
572
+        echo $'/usr/bin/node not found'
573
+        exit 7235728
574
+    fi
570 575
     wget https://www.npmjs.com/install.sh -O $rootdir/root/npm_install.sh
571 576
     if [ ! -f $rootdir/root/npm_install.sh ]; then
572 577
         echo $'Unable to download npm installer'