Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- run: pip install pytest pytest-cov numpy scipy matplotlib
- run: make test

Expand Down
18 changes: 13 additions & 5 deletions scripts/julia-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,20 @@ runner_path() {
runner=$(cd "$(dirname "$0")" && pwd)/$(basename "$0")
}

install_shim() {
validate_shim_path() {
runner_path
shim_path="${1:-$HOME/.local/bin/julia}"
case "$shim_path" in /*) ;; *) shim_path="$PWD/$shim_path";; esac
if [ -e "$shim_path" ] && [ "$shim_path" -ef "$runner" ]; then
validated_shim_path="${1:-$HOME/.local/bin/julia}"
case "$validated_shim_path" in
/*) ;;
*) validated_shim_path="$PWD/$validated_shim_path";;
esac
if [ -e "$validated_shim_path" ] && [ "$validated_shim_path" -ef "$runner" ]; then
fail "refusing to replace the daemon runner itself"
fi
}

install_shim() {
shim_path="$1"
resolve_real_julia
if [ -e "$shim_path" ]; then
first_line=$(IFS= read -r line <"$shim_path" && printf '%s' "$line")
Expand Down Expand Up @@ -388,8 +395,9 @@ case "$cmd" in
;;
install-shim)
[ $# -le 1 ] || fail "install-shim accepts at most one path"
validate_shim_path "${1:-}"
install_daemonmode
install_shim "${1:-}"
install_shim "$validated_shim_path"
;;
alias)
[ $# -eq 0 ] || fail "alias takes no arguments"
Expand Down
Loading