aboutsummaryrefslogtreecommitdiff
path: root/bin/plmu
blob: 7927ef92e8bc48fe9ca2583635db9b908241193c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

# Set up exceptions file if it exists
ef=$HOME/.plenv/non-cpanm-modules
[ -e "$ef" ] || ef=/dev/null

# Check that exceptions file is sorted
if ! sort -c -- "$ef" ; then
    printf '%s not sorted\n' "$ef" >&2
    exit 1
fi

# Get the list of modules
plenv list-modules |

# Exclude any modules in ~.plenv/non-cpanm-modules if it exists
comm -23 -- - "$ef" |

# Read that list of modules to upgrade and upgrade them one by one
while read -r module ; do
    cpanm --notest --quiet -- "$module"
done