From 8fc9ffa936241bd13e628e8af2ad581fd8e0a1c7 Mon Sep 17 00:00:00 2001 From: Randy Stauner Date: Tue, 16 Sep 2014 07:49:18 -0700 Subject: [PATCH] Update bin wrappers to use puppet and fallback to carton --- bin/prove | 2 +- bin/run | 24 ++++++------------------ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/bin/prove b/bin/prove index 6dcc40920..6d5fb7fe0 100755 --- a/bin/prove +++ b/bin/prove @@ -1,3 +1,3 @@ #!/bin/sh -`dirname "$0"`/carton exec -- prove -lv "$@" +`dirname "$0"`/run prove -lv "$@" diff --git a/bin/run b/bin/run index 529bc58be..3c4ded42a 100755 --- a/bin/run +++ b/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 -- "$@"