Unverified Commit 6c9cd7ca authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Changes shebang of executables to `/usr/bin/env` (#388)

# Description

This MR replaces `#!/bin/bash` with `#!/usr/bin/env bash`. This fetches
the executable from the `PATH` instead of having the path fixed. This
makes it more robust on different Unix systems. It should also allow you
to use bash scripts with zshell as well.

Fixes #384

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have run all the tests with `./orbit.sh --test` and they pass
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
parent 259cc9d3
#!/bin/bash
#!/usr/bin/env bash
# in the case you need to load specific modules on the cluster, add them here
# e.g., `module load eth_proxy`
......
#!/bin/bash
#!/usr/bin/env bash
#==
# Configurations
......
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2022-2024, The ORBIT Project Developers.
# All rights reserved.
......@@ -127,7 +127,7 @@ setup_conda_env() {
mkdir -p ${CONDA_PREFIX}/etc/conda/deactivate.d
# add variables to environment during activation
local isaacsim_setup_conda_env_script=${ORBIT_PATH}/_isaac_sim/setup_conda_env.sh
printf '%s\n' '#!/bin/bash' '' \
printf '%s\n' '#!/usr/bin/env bash' '' \
'# for isaac-sim' \
'source '${isaacsim_setup_conda_env_script}'' \
'' \
......@@ -141,7 +141,7 @@ setup_conda_env() {
# needed because deactivate complains about orbit alias since it otherwise doesn't exist
conda activate ${env_name}
# remove variables from environment during deactivation
printf '%s\n' '#!/bin/bash' '' \
printf '%s\n' '#!/usr/bin/env bash' '' \
'# for orbit' \
'unalias orbit &>/dev/null' \
'' \
......
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2022-2024, The ORBIT Project Developers.
# All rights reserved.
......
#!/usr/bin/python
#!/usr/bin/env python
# Copyright (c) 2022-2024, The ORBIT Project Developers.
# All rights reserved.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment