#! /bin/sh

# This script downloads Eldev startup script as `~/.local/bin/eldev'
# for use in a GitHub workflow.
#
# In your `.github/workflows/*.yml' add this:
#
#   run: curl -fsSL https://raw.github.com/emacs-eldev/eldev/master/webinstall/github-eldev | sh

set -e


ELDEV_BIN_DIR=~/.local/bin

# `$GITHUB_PATH' is a magic file which contents is translated to environment variable `$PATH'.
echo "$ELDEV_BIN_DIR" >> $GITHUB_PATH

mkdir -p $ELDEV_BIN_DIR
curl -fsSL https://raw.githubusercontent.com/emacs-eldev/eldev/master/bin/eldev > $ELDEV_BIN_DIR/eldev
chmod a+x $ELDEV_BIN_DIR/eldev