diff --git a/script/quick-start b/script/quick-start index 8eaf8cc..61e3c05 100755 --- a/script/quick-start +++ b/script/quick-start @@ -22,15 +22,26 @@ complain() { run() { say "\$ $@" - echo "$@" | sh - status="$?" - if [ $status -ne 0 ]; then + local rc=0 + "$@" || rc=$? + if [ $rc -ne 0 ]; then complain "E: The command \"$@\" failed with status code $status, we cannot proceed." complain "I: If you have no idea of what went wrong, please feel free to ask for help in the Noosfero community. Check the contact information in the project website (http://noosfero.org/)." exit 1 fi } +quiet() { + local tmpfile=$(mktemp) + local rc=0 + "$@" > "$tmpfile" 2>&1 || rc=$? + if [ $rc -ne 0 ]; then + cat "$tmpfile" + fi + rm -f "$tmpfile" + return $rc +} + gem_install() { if [ -w "$(ruby -rubygems -e 'puts Gem.dir')" ]; then run gem install --no-ri --no-rdoc $@ @@ -103,13 +114,15 @@ else rails runner 'Environment.default.enable("skip_new_user_email_confirmation")' fi -run 'rake noosfero:translations:compile >/dev/null 2>&1' +run quiet rake noosfero:translations:compile # create needed directory mkdir -p tmp/pids # use default gitignore rules -ln -s gitignore.example .gitignore || true +if [ ! -f .gitignore ]; then + ln -s gitignore.example .gitignore +fi # you can now start the server say "I: Congratulations, you are ready to run Noosfero." -- libgit2 0.21.2