Skip to content

Commit

Permalink
fix build not having ps
Browse files Browse the repository at this point in the history
  • Loading branch information
grass committed Dec 11, 2022
1 parent eaa74d8 commit b68bb05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/builds.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: cat /etc/os-release
- run: apt install -y psmisc
- run: apt-get update -y && apt-get install -y psmisc
- run: bash ./usr/bin/installer-dist -n -l debug -k -D

# vim: sw=4
9 changes: 8 additions & 1 deletion usr/bin/installer-dist
Expand Up @@ -1222,9 +1222,16 @@ get_utilities(){

## Set default traps
set_trap(){
## Sometimes ps is not available, default to sh.
if has ps; then
log warn "Missing program 'ps' to detect shell."
log warn "Will assume shell is 'sh'."
curr_shell="sh"
else
curr_shell="$(ps | awk "/ $$ /" | awk '{print $4}')"
fi
## Get current shell from current process
## If the process if the file name, get its shell from shebang
curr_shell="$(ps | awk "/ $$ /" | awk '{print $4}')"
## sometimes the process name is the base name of the script with some
## missing letters.
case "${0##*/}" in
Expand Down

0 comments on commit b68bb05

Please sign in to comment.