Skip to content

Commit

Permalink
Update bin wrappers to use puppet and fallback to carton
Browse files Browse the repository at this point in the history
  • Loading branch information
rwstauner committed Sep 16, 2014
1 parent 234f41a commit 8fc9ffa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bin/prove
@@ -1,3 +1,3 @@
#!/bin/sh

`dirname "$0"`/carton exec -- prove -lv "$@"
`dirname "$0"`/run prove -lv "$@"
24 changes: 6 additions & 18 deletions bin/run
@@ -1,22 +1,10 @@
#!/bin/sh

# NOTE: This script is used by puppet/cron jobs.
# Use the puppet-installed wrapper to set up the env properly.
wrapper=$HOME/bin/metacpan-api-carton
test -x $wrapper && \
exec $wrapper exec -- "$@"

# This wrapper script sets up the environment to run other local (repo) scripts.
# We need to use ./bin/carton to get the custom PERL_CARTON_PATH env var
# (where modules are installed).
# We also either need to chdir so that cpanfile is in $PWD
# or we need to determine the full path and set an env var.
# Changing to this dir is convenient for making shorter command lines,
# so we'll do that.

# Change to the parent dir of this script
# whether called with full, relative, or no path.
# If the wrapper doesn't exist, just try it with plain carton.
cd "`dirname "$0"`"/..

# Load perl env if necessary.
rc=/home/metacpan/.metacpanrc
test -r "$rc" && source "$rc"

# Run through carton exec (which expects ./cpanfile) to get the custom lib path.
exec bin/carton exec "$@"
exec carton exec -- "$@"

0 comments on commit 8fc9ffa

Please sign in to comment.