Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Set bash in Interactive mode and exit on errors in post-receive hook. #19

Closed
wants to merge 1 commit into from

2 participants

@blt

In interactive mode users' /etc/bash.bashrc (or /etc/bashrc, depending on OS) and ~/.bashrc will be sourced, allowing rbenv and RVM installations to be used without continual re-editing of deploy scripts. 'set -e' merely stops execution on failure of a sub-command. No runtime penalty for either change is incurred.

@blt blt Set bash in Interactive mode and exit on errors.
In interactive mode users' /etc/bash.bashrc (or /etc/bashrc, depending on OS) and ~/.bashrc will be sourced, allowing rbenv and RVM installations to be used without continual re-editing of deploy scripts. 'set -e' merely stops execution on failure of a sub-command. No runtime penalty for either change is incurred.
9707eb3
@zh zh referenced this pull request from a commit in zh/git-deploy
stoyan pull request #19 130eb2e
@mislav
Owner

Pulled! Thanks

@mislav mislav closed this
@mislav mislav referenced this pull request from a commit
@mislav don't run bash in interactive mode
First of all, we're lying - the shell isn't interactive. Second, it
causes the issue described in #30.

We'll have to find another way to support rbenv and RVM installations.

references #19, references #14
69fb872
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 20, 2012
  1. @blt

    Set bash in Interactive mode and exit on errors.

    blt authored
    In interactive mode users' /etc/bash.bashrc (or /etc/bashrc, depending on OS) and ~/.bashrc will be sourced, allowing rbenv and RVM installations to be used without continual re-editing of deploy scripts. 'set -e' merely stops execution on failure of a sub-command. No runtime penalty for either change is incurred.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/hooks/post-receive.sh
View
4 lib/hooks/post-receive.sh
@@ -1,4 +1,6 @@
-#!/usr/bin/env bash
+#!/bin/bash -i
+set -e
+
if [ "$GIT_DIR" = "." ]; then
# The script has been called as a hook; chdir to the working copy
cd ..
Something went wrong with that request. Please try again.