Commit 2f8c76652238e26118f18e8e5ce77527dd84a7b6
1 parent
73047d47
Exists in
master
and in
21 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 | 97 | else |
| 98 | 98 | dependencies_ok=true |
| 99 | 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 | 105 | if ! run $dependencies_file; then |
| 101 | 106 | dependencies_ok=false |
| 102 | 107 | fi | ... | ... |
script/quick-start
| ... | ... | @@ -90,9 +90,12 @@ else |
| 90 | 90 | # create the database with sample data |
| 91 | 91 | say 'Configuring Noosfero to use PostgreSQL, with your user.' |
| 92 | 92 | run cp config/database.yml.pgsql config/database.yml |
| 93 | + if [ -z "$USER" ]; then | |
| 94 | + USER=$(stat -c %U $0) | |
| 95 | + fi | |
| 93 | 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 | 100 | run rake db:schema:load |
| 98 | 101 | run rake db:data:minimal | ... | ... |