Skip to content

Instantly share code, notes, and snippets.

@thejohnfreeman
Last active March 17, 2018 02:46
Show Gist options
  • Select an option

  • Save thejohnfreeman/32b31ae80956fa859722fa84c6d42125 to your computer and use it in GitHub Desktop.

Select an option

Save thejohnfreeman/32b31ae80956fa859722fa84c6d42125 to your computer and use it in GitHub Desktop.
# Initial build directory should just be '.'. If and when you start using
# a build tool, change it to the output directory.
BUILD_DIR ?= build
# Default installation directory is specific to the development environment
# of the primary contributor.
INSTALL_DIR ?= /home/jfreeman/shared/reload-extension
# Recursively list all of the Git-visible files in the current directory.
# Effectively ignores temporary files and Git objects.
RSYNC_OPTS := --archive --delete --exclude='/.git' --filter=':- .gitignore' --filter=".- ${HOME}/.gitignore"
.PHONY: build test install
build:
npm run build
test:
npm test
install:
# Do not use Git because we want to install without first committing.
rsync ${RSYNC_OPTS} "${BUILD_DIR}/" "${INSTALL_DIR}"
#!/bin/bash
echo 'building extension'
export GIT_DIR="$(readlink --canonicalize "${GIT_DIR}")"
export GIT_WORK_TREE=$(mktemp --directory)
function cleanup() {
rm --recursive --force "${GIT_WORK_TREE}"
}
trap cleanup EXIT
echo "GIT_WORK_TREE='${GIT_WORK_TREE}'"
mkdir --parents "${GIT_WORK_TREE}"
git checkout --force
cd "${GIT_WORK_TREE}"
INSTALL_DIR='/home/jfreeman/shared/table-scraper' make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment