aboutsummaryrefslogtreecommitdiff
path: root/bin/plenv-modules-update
blob: 504cf13ff733a5f6ca9ed3fc629c8b5440f41543 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash

LANG=C.UTF-8
export LANG

hash cpanm plenv || exit

mf=$(mktemp) || exit
ef=$(mktemp) || exit
cf=$(mktemp) || exit

cleanup() {
    rm -f -- "$mf" "$ef" "$cf"
}
trap cleanup EXIT

plenv list-modules | sort > "$mf"
sort "$HOME"/.plenv/non-cpanm-modules > "$ef"
comm -23 -- "$mf" "$ef" > "$cf"

while read -r module ; do 
    cpanm --from http://cpan.inspire.net.nz --notest --quiet -- "$module"
done < "$cf"