Commit 24c76fe1d504926c870d295aa8fab3ce1d192242

Authored by Rodrigo Souto
1 parent f848b280

Adding install.rb file for plugins

(ActionItem2776)
plugins/bsc/install.rb 0 → 100644
... ... @@ -0,0 +1 @@
  1 +raise "Not ready yet"
... ...
plugins/ldap/install.rb 0 → 100644
... ... @@ -0,0 +1 @@
  1 +raise "Not ready yet"
... ...
plugins/mezuro/install.rb 0 → 100644
... ... @@ -0,0 +1 @@
  1 +raise "Not ready yet"
... ...
plugins/stoa/install.rb 0 → 100644
... ... @@ -0,0 +1 @@
  1 +raise "Not ready yet"
... ...
script/noosfero-plugins
... ... @@ -86,12 +86,18 @@ _enable(){
86 86 echo "E: $plugin plugin does not exist!"
87 87 return
88 88 fi
89   - dependencies_ok=true
90   - dependencies_file="$source/dependencies.rb"
91   - if ! run $dependencies_file; then
92   - dependencies_ok=false
  89 + installation_ok=true
  90 + installation_file="$source/install.rb"
  91 + if ! run $installation_file; then
  92 + installation_ok=false
  93 + else
  94 + dependencies_ok=true
  95 + dependencies_file="$source/dependencies.rb"
  96 + if ! run $dependencies_file; then
  97 + dependencies_ok=false
  98 + fi
93 99 fi
94   - if [ "$dependencies_ok" = true ]; then
  100 + if [ "$installation_ok" = true ] && [ "$dependencies_ok" = true ]; then
95 101 ln -s "$source" "$target"
96 102 plugins_public_dir="$NOOSFERO_DIR/public/plugins"
97 103 plugins_features_dir="$NOOSFERO_DIR/features/plugins"
... ... @@ -100,7 +106,9 @@ _enable(){
100 106 _say "$plugin enabled"
101 107 run "$source/after_enable.rb"
102 108 needs_migrate=true
103   - else
  109 + elif [ "$installation_ok" = false ]; then
  110 + echo "W: failed to install $plugin; not enabling"
  111 + elif [ "$dependencies_ok" = false ]; then
104 112 echo "W: failed to load dependencies for $plugin; not enabling"
105 113 fi
106 114 fi
... ...