Skip to content

Commit

Permalink
Check for existence of process files
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Ford authored and Alex Ford committed Apr 17, 2024
1 parent c7b713a commit 962361f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions detect_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ arm* | aarch64)
esac

# Check if running in Docker.
if [ -f /.dockerenv ] || grep -qa docker /proc/1/cgroup; then
if [ -f /.dockerenv ] || { [ -f /proc/1/cgroup ] && grep -qa docker /proc/1/cgroup; }; then
is_docker=true
fi

Expand All @@ -24,7 +24,7 @@ if [ "$(uname)" = "Darwin" ]; then
fi

# Check if running on WSL.
if grep -qi microsoft /proc/sys/kernel/osrelease; then
if [ -f /proc/sys/kernel/osrelease ] && grep -qi microsoft /proc/sys/kernel/osrelease; then
is_wsl=true
fi

Expand Down

0 comments on commit 962361f

Please sign in to comment.