diff --git a/.pkgr.yml b/.pkgr.yml new file mode 100644 index 00000000000..39a5f66dde4 --- /dev/null +++ b/.pkgr.yml @@ -0,0 +1 @@ +before_precompile: ./packaging/debian/setup.sh diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb index 6642a0dfd20..ec5dd2ae1f7 100644 --- a/lib/js_locale_helper.rb +++ b/lib/js_locale_helper.rb @@ -43,7 +43,7 @@ module JsLocaleHelper end def self.moment_format_function(name) - format = I18n.t("dates." << name) + format = I18n.t("dates.#{name}") result = "moment.fn.#{name.camelize(:lower)} = function(){ return this.format('#{format}'); };\n" end diff --git a/packaging/debian/setup.sh b/packaging/debian/setup.sh index 72afe2d6c08..1d7424f5e94 100755 --- a/packaging/debian/setup.sh +++ b/packaging/debian/setup.sh @@ -1,8 +1,17 @@ #!/bin/sh -# This script installs the required example config files before buildpack compilation. +# This script sets up the required config files before buildpack compilation. +# +# It also launches a postgresql server and a redis server, otherwise some rake +# tasks can't be completed. -set -ex +set -e -cp config/database.yml.production-sample config/database.yml -cp config/redis.yml.sample config/redis.yml -cp config/environments/production.rb.sample config/environments/production.rb +# Not everyone chooses to run discourse behind Apache or Nginx. +cat >> config/environments/production.rb <