Browse Source

npm architecture

Bob Mottram 7 years ago
parent
commit
15b6762f79
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      src/freedombone-image-customise

+ 10
- 2
src/freedombone-image-customise View File

@@ -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