Skip to content
This repository has been archived by the owner on Oct 4, 2018. It is now read-only.

Commit

Permalink
Making perl regular expression more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
hferentschik committed Nov 19, 2011
1 parent 1e07b38 commit 20e3bb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .openshift/action_hooks/build
Expand Up @@ -9,8 +9,9 @@ export

# set a variable pointing to the bare repo
# we cannot work against the checkout, since it is a archive without .git
$OPENSHIFT_BARE_REPO=/var/lib/libra/$OPENSHIFT_APP_UUID/git/$OPENSHIFT_APP_NAME.git
declare -x BARE_REPO="$HOME/git/$OPENSHIFT_APP_NAME.git"

# Gollum needs the git repo in its configuration. Using Perl and in place regular
# expression replacement we get the right value into config.ru.
perl -pi -0777 -e "s/<bare-repo>/$OPENSHIFT_BARE_REPO/g" $OPENSHIFT_REPO_DIR/config.ru
perl -pi -0777 -e "s@<repo>@$BARE_REPO@g" $OPENSHIFT_REPO_DIR/config.ru

2 changes: 1 addition & 1 deletion config.ru
Expand Up @@ -7,6 +7,6 @@ use Rack::Auth::Basic, "Welcome wiki - authenticate!" do |name, password|
[name, password] == ['wiki', 'wiki']
end

Precious::App.set(:gollum_path, '<bare-repo>')
Precious::App.set(:gollum_path, '<repo>')
Precious::App.set(:wiki_options, {})
run Precious::App

0 comments on commit 20e3bb8

Please sign in to comment.