Browse Source

Install bower as root

master
Bob Mottram 1 month ago
parent
commit
5b668dd67f
1 changed files with 8 additions and 7 deletions
  1. 8
    7
      src/freedombone-app-cryptpad

+ 8
- 7
src/freedombone-app-cryptpad View File

@@ -127,7 +127,9 @@ function upgrade_cryptpad {
127 127
     cryptpad_create_config
128 128
     npm upgrade
129 129
     npm install
130
-    su -c 'npm install bower@1.8.4' - cryptpad
130
+    if [ ! -d "$CRYPTPAD_DIR/node_modules/bower/bin/bower" ]; then
131
+        npm install bower@1.8.8
132
+    fi
131 133
     rm -rf $CRYPTPAD_DIR/.cache/bower
132 134
     su -c './node_modules/bower/bin/bower install --config.interactive=false' - cryptpad
133 135
     su -c './node_modules/bower/bin/bower update --config.interactive=false' - cryptpad
@@ -659,13 +661,7 @@ function install_cryptpad {
659 661
 
660 662
     increment_app_install_progress
661 663
 
662
-    su -c 'npm install bower@1.8.4' - cryptpad
663
-
664
-    increment_app_install_progress
665
-
666 664
     chown -R cryptpad:cryptpad $CRYPTPAD_DIR
667
-    su -c './node_modules/bower/bin/bower install --config.interactive=false' - cryptpad
668
-    su -c './node_modules/bower/bin/bower update --config.interactive=false' - cryptpad
669 665
     cp config/config.example.js config/config.js
670 666
     if [ ! -f config/config.js ]; then
671 667
         echo $'Cryptpad config file not found'
@@ -710,7 +706,12 @@ function install_cryptpad {
710 706
 
711 707
     # install again
712 708
     cd $CRYPTPAD_DIR || exit 73
709
+    npm install bower@1.8.8
710
+    increment_app_install_progress
711
+    chown -R cryptpad:cryptpad $CRYPTPAD_DIR/node_modules/bower
713 712
     su -c './node_modules/bower/bin/bower install --config.interactive=false' - cryptpad
713
+    increment_app_install_progress
714
+    su -c './node_modules/bower/bin/bower update --config.interactive=false' - cryptpad
714 715
 
715 716
     increment_app_install_progress
716 717
 

Loading…
Cancel
Save