Skip to content

Commit

Permalink
Make the .git/safe directory in bin/setup
Browse files Browse the repository at this point in the history
Assuming the binstubs for a project are in the local `bin/` directory,
we can add the directory to shell `$PATH` so that `rspec` can be invoked
without the `bin/` prefix:

    export PATH="./bin:$PATH"

Doing so on a system that other people have write access to (such as a
shared host) is a security risk:

rbenv/rbenv#309

The `.git/safe` convention addresses the security problem:

https://twitter.com/tpope/status/165631968996900865

I used to do this manually before, as I have it in my `$PATH`
https://github.com/mehlah/dotfiles/blob/master/zshenv#L12-13
  • Loading branch information
Mehdi Lahmam committed Jul 11, 2015
1 parent f15e75e commit 4c6bb39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions templates/bin_setup
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ fi
# Set up the database
bundle exec rake db:setup

# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
mkdir -p .git/safe

# Pick a port for Foreman
echo "port: 7000" > .foreman

0 comments on commit 4c6bb39

Please sign in to comment.