File: basic-test.sh

package info (click to toggle)
opam 2.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,636 kB
  • sloc: ml: 48,368; sh: 2,017; ansic: 808; makefile: 397; sed: 6; csh: 1
file content (23 lines) | stat: -rwxr-xr-x 380 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -eu

if command -v tput > /dev/null; then
    YELLOW="$(tput setaf 3)"
    RESET="$(tput sgr0)"
else
    YELLOW=""
    RESET=""
fi

run() {
    echo "${YELLOW}\$ $@${RESET}"
    "$@"
    echo
}

SWITCH="$(basename $0)"
export HOME="$(mktemp -d)"
trap 'rm -rf -- "$HOME"' EXIT

run opam init --no-setup --compiler="$SWITCH"
run opam install -y merlin ocp-indent utop