From d625e3961b16a7fcaa2d8070cafc124e9cfbb7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Sverre=20Lien=20Sell=C3=A6g?= Date: Sun, 8 Nov 2020 20:35:39 +0100 Subject: [PATCH] move scrape to bin directory --- Dockerfile | 2 +- scrape => bin/scrape | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) rename scrape => bin/scrape (94%) diff --git a/Dockerfile b/Dockerfile index a602a01..049d3e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ MAINTAINER Jørgen Sverre Lien Sellæg ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser \ - PATH="$PATH:/app" + PATH="$PATH:/app/bin" RUN apk add --no-cache \ chromium \ diff --git a/scrape b/bin/scrape similarity index 94% rename from scrape rename to bin/scrape index ab8a420..96832ab 100755 --- a/scrape +++ b/bin/scrape @@ -1,5 +1,8 @@ #!/bin/bash +readonly BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +readonly RUN_DIR=$(pwd) + function usage { cat <<- EOF ./scrape [options] @@ -77,6 +80,10 @@ function scrape { node src/scrape.js "$@" || usage } +cd "$BIN_DIR"/.. + check_dependencies \ && parse_args "$@" \ && scrape "$@" + +cd "$RUN_DIR"