File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 # Check that the profile got loaded
4747 assert "$FAKE_PROFILE" == "1"
4848 '' ;
49+
50+ # Devshell entrypoint script features
51+ devshell-entrypoint-1 =
52+ let
53+ shell = devshell . mkShell {
54+ devshell . name = "devshell-entrypoint-1" ;
55+ devshell . packages = [ pkgs . git ] ;
56+ } ;
57+ in
58+ runTest "devshell-entrypoint-1" { } ''
59+ entrypoint_clean() {
60+ env -u IN_NIX_SHELL -u PRJ_ROOT ${ shell } /entrypoint "$@"
61+ }
62+
63+ # No packages in PATH
64+ ! type -p git
65+
66+ # Exits badly if PRJ_ROOT isn't set, or if we cannot assume PRJ_ROOT
67+ # should be PWD.
68+ ! msg="$(entrypoint_clean /bin/sh -c 'exit 0' 2>&1)"
69+ assert "$msg" == 'ERROR: please set the PRJ_ROOT env var to point to the project root'
70+
71+ # Succeeds with --prj-root set
72+ entrypoint_clean --prj-root . /bin/sh -c 'exit 0'
73+
74+ # Packages available through entrypoint
75+ entrypoint_clean --prj-root . /bin/sh -c 'type -p git'
76+
77+ # Packages available through entrypoint in pure mode
78+ entrypoint_clean --pure --env-bin env --prj-root . /bin/sh -c 'type -p git'
79+ '' ;
4980}
You can’t perform that action at this time.
0 commit comments