Browse Source

move scrape to bin directory

fix-broken-scrape
Jørgen Lien Sellæg 6 years ago
parent
commit
d625e3961b
  1. 2
      Dockerfile
  2. 7
      bin/scrape

2
Dockerfile

@ -3,7 +3,7 @@ MAINTAINER Jørgen Sverre Lien Sellæg <jorgen@guut.org>
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 \

7
scrape → 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] <page>
@ -77,6 +80,10 @@ function scrape {
node src/scrape.js "$@" || usage
}
cd "$BIN_DIR"/..
check_dependencies \
&& parse_args "$@" \
&& scrape "$@"
cd "$RUN_DIR"
Loading…
Cancel
Save