From 0f8cf4914f49af9965e5002dcedfbfe06b1a8420 Mon Sep 17 00:00:00 2001 From: 347Online <38228372+347Online@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:07:49 -0600 Subject: [PATCH] Modify command for generating script_dir Intent is to let the script find the correct path to the executable, even if it is being run via symlink Add macOS-specific system files to .gitignore --- .gitignore | 3 +++ jlox | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b568f5721..6b5e66f7c 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ xcuserdata/ # Dart stuff. /tool/.dart_tool/ /tool/.packages + +# macOS-specific System Files +*.DS_Store \ No newline at end of file diff --git a/jlox b/jlox index b2a0e7143..b8637e219 100755 --- a/jlox +++ b/jlox @@ -1,4 +1,4 @@ #!/usr/bin/env bash -script_dir=$(dirname "$0") +script_dir="$(dirname "$(readlink -f "$0")")" java -cp ${script_dir}/build/java com.craftinginterpreters.lox.Lox $@