Browse Source

Don't try to install global packages as a local user

Bob Mottram 7 years ago
parent
commit
12c690abd5
1 changed files with 14 additions and 6 deletions
  1. 14
    6
      src/freedombone-app-scuttlebot

+ 14
- 6
src/freedombone-app-scuttlebot View File

@@ -395,12 +395,6 @@ cd /etc/scuttlebot || exit 1
395 395
 if ! npm install --arch=$NPM_ARCH scuttlebot@${SCUTTLEBOT_VERSION}; then
396 396
     exit 2
397 397
 fi
398
-if ! npm install --arch=$NPM_ARCH -g git-ssb; then
399
-    exit 3
400
-fi
401
-if ! npm install --arch=$NPM_ARCH -g git-remote-ssb; then
402
-    exit 4
403
-fi
404 398
 exit 0
405 399
 EOF
406 400
     chroot "$rootdir" /bin/chmod +x /usr/bin/install_scuttlebot
@@ -412,6 +406,20 @@ EOF
412 406
         exit 528253
413 407
     fi
414 408
 
409
+    cat <<EOF > "$rootdir/usr/bin/install_git_ssb"
410
+#!/bin/bash
411
+if ! npm install --arch=$NPM_ARCH -g git-ssb; then
412
+    exit 1
413
+fi
414
+if ! npm install --arch=$NPM_ARCH -g git-remote-ssb; then
415
+    exit 2
416
+fi
417
+exit 0
418
+EOF
419
+    chroot "$rootdir" /bin/chmod +x /usr/bin/install_git_ssb
420
+    chroot "$rootdir" /usr/bin/install_git_ssb
421
+    rm "$rootdir/usr/bin/install_git_ssb"
422
+
415 423
     # daemon
416 424
     { echo '[Unit]';
417 425
       echo 'Description=Scuttlebot (messaging system)';