bootstrap cpm and keep cpm updated, and plenv shims

Thu, 31 Oct 2019 17:48:12 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Thu, 31 Oct 2019 17:48:12 -0500
changeset 816
f058603b86b6
parent 815
478ee3262dce
child 817
3c7ab878a1b5

bootstrap cpm and keep cpm updated, and plenv shims

bin/setup-cpan-faves file | annotate | diff | comparison | revisions
--- a/bin/setup-cpan-faves
+++ b/bin/setup-cpan-faves
@@ -2,6 +2,8 @@
 set -eu -o pipefail
 
 dists=(
+  App::cpm
+
   Perl::Tidy
   Pod::Cpandoc
 
@@ -21,7 +23,13 @@ dists=(
   Getopt::Long::Descriptive
 )
 
-command -v cpm &>/dev/null ||
-  cpanm App::cpm
+if ! command -v cpm &>/dev/null; then
+  curl -fsSL --compressed https://git.io/cpm |
+    perl - install -g App::cpm
 
-exec cpm install -g "${dists[@]}"
+  plenv rehash || :
+fi
+
+cpm install -g "${dists[@]}"
+
+plenv rehash || :

mercurial