Skip to content

Commit

Permalink
Simplify path handling.
Browse files Browse the repository at this point in the history
When run from cron I was using an absolute path for the results dir, but
then we were tacking `../..` onto it, which makes no sense.

Rather than handle both cases, let's just say you have to use an
absolute path.
  • Loading branch information
vext01 committed Jan 10, 2025
1 parent f8e036a commit f7f5bd7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ fi

RES_DIR=$1; shift

# To simplify path handling, require the results dir to be absolute.
if [ "$(realpath "${RES_DIR}")" != "${RES_DIR}" ]; then
echo "Please use an absolute path for the results directory"
exit 1
fi

# Create a place for the results file to live if necessary.
#
# We are going to put results files in YYYY-MM sub-directories so that we don't
Expand Down Expand Up @@ -76,5 +82,5 @@ ${TOML_BIN} set --toml-path ${EXTRA_TOML} versions.yklua "$(cd yklua && git rev-
venv/bin/rebench --no-denoise -c rebench.conf

# File away the results file (and extra info file) in the output directory.
cp ${EXTRA_TOML} ../../${RES_SUBDIR}/${YMDHMS}-extra.toml
cp benchmark.data ../../${RES_SUBDIR}/${YMDHMS}.data
cp ${EXTRA_TOML} ${RES_SUBDIR}/${YMDHMS}-extra.toml
cp benchmark.data ${RES_SUBDIR}/${YMDHMS}.data

0 comments on commit f7f5bd7

Please sign in to comment.