#!/usr/bin/env bash
echo "ruby '2.1.6'" > Gemfile.local

cp -f packaging/conf/configuration.yml config/configuration.yml
sed -i "s|config.serve_static_files = false|config.serve_static_files = true|" config/environments/production.rb

# Specific npmrc used for packaging
cp -f packaging/.npmrc .npmrc

# replace every occurrence of openproject with the corresponding application name we're packaging
find packaging/ -type f -print0 | xargs -0 sed -i "s|openproject|${APP_NAME}|"
