Util.pm: add util_path function
commitaf82ea23c009d4d920fba41aad34165c9550edf3
authorKyle J. McKay <mackyle@gmail.com>
Mon, 1 Jan 2018 03:48:34 +0000 (31 19:48 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Mon, 1 Jan 2018 03:48:34 +0000 (31 19:48 -0800)
tree8461305940b0cf27a42e77bc6164e1abe6f0dfcb
parentea7c13ec3d88734be088f203f71fa31bb8814e65
Util.pm: add util_path function

When running external commands, sometimes it's necessary to make
sure they find and use the configured Git and other utilities rather
than some random instance of them on the system.

Provide a util_path function that returns a suitably prefixed PATH
value that can be assigned to $ENV{PATH} or otherwise used as the
PATH.  The provided PATH will always find the configured Git and
similar utilities first before any other variants on the system.

The util_path function has idempotent behavior in that if the prefix
is already present on $ENV{PATH} it just returns $ENV{PATH} as-is.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Util.pm