瀏覽代碼

npm architecture

Bob Mottram 7 年之前
父節點
當前提交
15b6762f79
共有 1 個檔案被更改,包括 10 行新增2 行删除
  1. 10
    2
      src/freedombone-image-customise

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

@@ -562,13 +562,21 @@ INSTALL_DIR=$HOME/build
562 562
 INSTALLING_MESH=
563 563
 
564 564
 install_patchwork() {
565
+    NPM_ARCH='ia32'
566
+    if [[ $ARCHITECTURE == 'arm'* ]]; then
567
+        NPM_ARCH='armv7l'
568
+    fi
569
+    if [[ $ARCHITECTURE == 'x86_64' || $ARCHITECTURE == 'amd64' ]]; then
570
+        NPM_ARCH='x64'
571
+    fi
572
+
565 573
     git clone https://github.com/ssbc/patchwork $rootdir/etc/patchwork
566 574
 
567 575
     cat <<EOF > $rootdir/usr/bin/install_patchwork
568 576
 #!/bin/bash
569 577
 cd /etc/patchwork
570
-npm install --arch=ia32 electron
571
-npm install
578
+npm install --arch=$NPM_ARCH electron
579
+npm install --arch=$NPM_ARCH
572 580
 EOF
573 581
     chroot "$rootdir" /bin/chmod +x /usr/bin/install_patchwork
574 582
     chroot "$rootdir" /usr/bin/install_patchwork