From 748c3633ce794685af343de0bcd24eca7440281b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 20 Jan 2022 18:34:18 +0000 Subject: move dtas-graph into script/, support Perl for dtas.sh "script/" is the standard location for Perl ExtUtils::MakeMaker-based installations, so and we'll probably overload "lib" to support Perl scripts. This is another step in expanding our use of Perl5 and avoiding the slow startup and API instability of Ruby. --- dtas.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dtas.sh') diff --git a/dtas.sh b/dtas.sh index d3ea5e1..1ceca15 100755 --- a/dtas.sh +++ b/dtas.sh @@ -1,7 +1,8 @@ #!/bin/sh -e # symlink this file to a directory in PATH to run dtas (or anything in bin/*) # without needing perms to install globally. Used by "make symlink-install" -p=$(realpath "$0" || readlink "$0") # neither is POSIX, but common -p=$(dirname "$p") c=$(basename "$0") # both are POSIX -exec ${RUBY-ruby} -I"$p"/lib "$p"/bin/"${c%.sh}" "$@" +p=$(realpath "$0" || readlink "$0"); # neither is POSIX, but common +p=$(dirname "$p") c=$(basename "$0"); c="${c%.sh}" +if test -x "$p/bin/$c"; then exec ${RUBY-ruby} -I"$p"/lib "$p/bin/$c" "$@"; +else exec ${PERL-perl} -I"$p"/lib "$p/script/$c" "$@"; fi : this script is too short to copyright -- cgit v1.2.3-24-ge0c7