Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.
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
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: test
on: [push, pull_request]
jobs:

shellcheck:
name: "Run shellcheck on the shell env script"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install shellcheck"
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: "Run shellcheck on the shell env script"
run: |
# exclude warning for sourcing missing external file
shellcheck extra/share/dune/env/env.sh extra/share/dune/env/env.bash
3 changes: 3 additions & 0 deletions extra/share/dune/env/env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ __dune_env() {
;;
esac

# Load bash completions for dune.
# Suppress warning from shellcheck as it can't see the completion script.
# shellcheck disable=SC1091
. "$ROOT"/share/bash-completion/completions/dune
}
22 changes: 22 additions & 0 deletions extra/share/dune/env/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

__dune_env() {
if [ "$#" != "1" ]; then
echo "__dune_env expected 1 argument, got $#"
return
fi
__dune_root="$1"

# Add dune to PATH unless it's already present.
# Affix colons on either side of $PATH to simplify matching (based on
# rustup's env script).
case :"$PATH": in
*:"$__dune_root/bin":*)
# Do nothing since the bin directory is already in PATH.
;;
*)
# Prepending path in case a system-installed dune needs to be overridden
export PATH="$__dune_root/bin:$PATH"
;;
esac
}