-
Notifications
You must be signed in to change notification settings - Fork 7
Ext as default shell #265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Ext as default shell #265
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,3 +231,5 @@ initial_dataset_40*/ | |
|
|
||
| # Reinclude | ||
| !src/sampleworks/data/protein_configs.csv | ||
|
|
||
| .idea | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [process_trace] | ||
| tracer = "ebpf" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| profile_script="/etc/profile.d/sampleworks-ext-shell.sh" | ||
| profile_comment="# Sampleworks: enter ext when ACTL sets EXT_SHELL=1." | ||
| profile_line="[ -r ${profile_script} ] && . ${profile_script}" | ||
|
|
||
| touch /root/.bashrc /home/dev/.bashrc | ||
|
|
||
| for profile_file in /etc/bash.bashrc /root/.bashrc /home/dev/.bashrc /etc/zsh/zshrc /etc/zsh/zprofile; do | ||
| if [ ! -e "${profile_file}" ]; then | ||
| continue | ||
| fi | ||
| if grep -Fqs "${profile_line}" "${profile_file}"; then | ||
| continue | ||
| fi | ||
| printf '\n%s\n%s\n' "${profile_comment}" "${profile_line}" >> "${profile_file}" | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| EXT_VERSION="${EXT_VERSION:-v0.1.1}" | ||
| EXT_INSTALL_DIR="${EXT_INSTALL_DIR:-/usr/local/bin}" | ||
|
|
||
| curl -fsSL https://extshell.org/install.sh | bash -s -- --version "${EXT_VERSION}" --dir "${EXT_INSTALL_DIR}" | ||
| install -d -m 0755 /home/dev/.local/share/ext | ||
| install -m 0644 /usr/local/share/sampleworks/astera/ext-config.toml /home/dev/.local/share/ext/config.toml | ||
| command -v ext >/dev/null 2>&1 | ||
| ext --help >/dev/null | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Enter ext only when ACTL sets EXT_SHELL=1. | ||
| [ "${EXT_SHELL:-}" = "1" ] || return 0 2>/dev/null || exit 0 | ||
|
|
||
| case "$-" in | ||
| *i*) ;; | ||
| *) return 0 2>/dev/null || exit 0 ;; | ||
| esac | ||
|
|
||
| [ -t 0 ] || return 0 2>/dev/null || exit 0 | ||
|
marcuscollins marked this conversation as resolved.
|
||
| [ -t 1 ] || return 0 2>/dev/null || exit 0 | ||
| [ -z "${SAMPLEWORKS_EXT_SHELL_ATTEMPTED:-}" ] || return 0 2>/dev/null || exit 0 | ||
| [ -z "${EXT_SHELL_ACTIVE:-}" ] || return 0 2>/dev/null || exit 0 | ||
| [ -z "${BASH_EXECUTION_STRING:-}" ] || return 0 2>/dev/null || exit 0 | ||
| [ -z "${ZSH_EXECUTION_STRING:-}" ] || return 0 2>/dev/null || exit 0 | ||
| command -v ext >/dev/null 2>&1 || return 0 2>/dev/null || exit 0 | ||
|
|
||
| __sampleworks_ext_config_template="/usr/local/share/sampleworks/astera/ext-config.toml" | ||
| __sampleworks_ext_data_home="${XDG_DATA_HOME:-${HOME:-/home/dev}/.local/share}" | ||
| __sampleworks_ext_config_dir="${__sampleworks_ext_data_home}/ext" | ||
| __sampleworks_ext_config="${__sampleworks_ext_config_dir}/config.toml" | ||
| mkdir -p "${__sampleworks_ext_config_dir}" 2>/dev/null || true | ||
| if [ ! -e "${__sampleworks_ext_config}" ] && [ -r "${__sampleworks_ext_config_template}" ]; then | ||
| cp "${__sampleworks_ext_config_template}" "${__sampleworks_ext_config}" 2>/dev/null || true | ||
|
marcuscollins marked this conversation as resolved.
|
||
| fi | ||
| unset __sampleworks_ext_config_template __sampleworks_ext_data_home | ||
| unset __sampleworks_ext_config_dir __sampleworks_ext_config | ||
|
|
||
| __sampleworks_ext_inner_shell="" | ||
| if [ -n "${BASH_VERSION:-}" ]; then | ||
| __sampleworks_ext_inner_shell="bash" | ||
| elif [ -n "${ZSH_VERSION:-}" ]; then | ||
| __sampleworks_ext_inner_shell="zsh" | ||
| fi | ||
|
|
||
| if [ -n "${__sampleworks_ext_inner_shell}" ]; then | ||
| export SAMPLEWORKS_EXT_SHELL_ATTEMPTED=1 | ||
| exec ext shell -shell "${__sampleworks_ext_inner_shell}" | ||
| fi | ||
| unset __sampleworks_ext_inner_shell | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checks that ext is in path after install.
Failing the build if it is not