ligo/scripts/opam-upgrade.sh
Grégoire Henry d2708740c8 Opam: fix some dependencies and add some scripts/opam-*.sh.
Installation:

   `./scripts/opam-pin.sh && opam install tezos-node tezos-client`

Upgrade installed packages after a `git pull` (opam2 only):

   `./scripts/opam-upgrade.sh`

Remove and cleanup every from the opam repo:

   `./scripts/opam-unpin.sh`
2017-12-08 02:50:03 +01:00

36 lines
591 B
Bash
Executable File

#! /bin/sh
set -e
script_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
src_dir="$(dirname "$script_dir")"
cd "$src_dir"
cleanup () {
set +e
if [ -f LOG ]; then
echo "Failure"
echo
cat LOG
echo
exit 1
fi
}
trap cleanup EXIT INT
silent () {
"$@" > LOG 2>&1
rm LOG
}
echo "Updating package description..."
silent . ./scripts/opam-pin.sh
upgradables=$(opam list --short --installed $packages)
if [ -z "$upgradables" ]; then
echo "No previously installed package. Nothing to do."
exit 1
fi
opam upgrade $upgradables