Skip to content

Commit

Permalink
allow for relative paths for the Docker front end
Browse files Browse the repository at this point in the history
  • Loading branch information
BraveSirRobin committed Dec 13, 2022
1 parent f435ae2 commit fa3133d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ function err_exit {
exit 1
}

if [[ ! -e $(which realpath) ]]; then
realpath() (
OURPWD=$PWD
cd "$(dirname "$1")"
LINK=$(readlink "$(basename "$1")")
while [ "$LINK" ]; do
cd "$(dirname "$LINK")"
LINK=$(readlink "$(basename "$1")")
done
REALPATH="$PWD/$(basename "$1")"
cd "$OURPWD"
echo "$REALPATH"
)
fi

XSLT=to-json.xslt
NUM_PROCS=4
DOCKER_IMG_REF='robinharvey/pdftxt'
Expand Down Expand Up @@ -79,6 +94,8 @@ function metal_run {
}

function docker_run {
OUT_DIR=$(realpath "${OUT_DIR}")
PDF=$(realpath "${PDF}")
docker pull $DOCKER_IMG_REF
docker run -ti \
--mount type=bind,source=${OUT_DIR},destination=/output \
Expand Down

0 comments on commit fa3133d

Please sign in to comment.