From 15203be615fc00f356a0e112e0922480c4bc92fe Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 6 Dec 2020 16:32:23 +0100 Subject: [PATCH] 2020 day2/vhdl: allow script to be run from outside its basedir --- 2020/day2/vhdl/run.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/2020/day2/vhdl/run.sh b/2020/day2/vhdl/run.sh index 2094a93..4d5d87d 100755 --- a/2020/day2/vhdl/run.sh +++ b/2020/day2/vhdl/run.sh @@ -1,11 +1,13 @@ -#!/usr/bin/env sh +#!/usr/bin/bash set -eu -INPUT=$1 +INPUT=$(readlink --canonicalize-existing "$1") MODE=${2:-} GHDLFLAGS="--std=08 --workdir=workdir" +cd "$(dirname "${BASH_SOURCE[0]}")" + mkdir -p workdir if [[ $MODE = "--synth" ]]; then