Commit 2f8c76652238e26118f18e8e5ce77527dd84a7b6
1 parent
73047d47
Exists in
master
and in
22 other branches
quick-start: fix database creation
Showing
2 changed files
with
10 additions
and
2 deletions
Show diff stats
script/noosfero-plugins
@@ -97,6 +97,11 @@ _enable(){ | @@ -97,6 +97,11 @@ _enable(){ | ||
97 | else | 97 | else |
98 | dependencies_ok=true | 98 | dependencies_ok=true |
99 | dependencies_file="$source/dependencies.rb" | 99 | dependencies_file="$source/dependencies.rb" |
100 | + if [ -e $source/Gemfile ]; then | ||
101 | + if ! (cd $source && bundle --local); then | ||
102 | + dependencies_ok=false | ||
103 | + fi | ||
104 | + fi | ||
100 | if ! run $dependencies_file; then | 105 | if ! run $dependencies_file; then |
101 | dependencies_ok=false | 106 | dependencies_ok=false |
102 | fi | 107 | fi |
script/quick-start
@@ -90,9 +90,12 @@ else | @@ -90,9 +90,12 @@ else | ||
90 | # create the database with sample data | 90 | # create the database with sample data |
91 | say 'Configuring Noosfero to use PostgreSQL, with your user.' | 91 | say 'Configuring Noosfero to use PostgreSQL, with your user.' |
92 | run cp config/database.yml.pgsql config/database.yml | 92 | run cp config/database.yml.pgsql config/database.yml |
93 | + if [ -z "$USER" ]; then | ||
94 | + USER=$(stat -c %U $0) | ||
95 | + fi | ||
93 | sed -ri "s/username: noosfero/username: $USER/" config/database.yml | 96 | sed -ri "s/username: noosfero/username: $USER/" config/database.yml |
94 | - sudo su - postgres -c "createuser $USER --no-superuser --createdb --no-createrole" | ||
95 | - sudo su - postgres -c "createdb noosfero_development -O $USER" | 97 | + sudo su - postgres -c "createuser $USER --no-superuser --createdb --no-createrole" || true |
98 | + sudo su - postgres -c "createdb noosfero_development -O $USER" || true | ||
96 | 99 | ||
97 | run rake db:schema:load | 100 | run rake db:schema:load |
98 | run rake db:data:minimal | 101 | run rake db:data:minimal |