Skip to content

Commit

Permalink
Merge pull request #975 from afender/upgrade_issue_template
Browse files Browse the repository at this point in the history
[REVIEW] Upgrade GitHub template
  • Loading branch information
BradReesWork authored Jun 29, 2020
2 parents 19583b7 + abb39ba commit 55aaa06
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions print_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
# "./print_env.sh" - prints to stdout
# "./print_env.sh > env.txt" - prints to file "env.txt"

print_env() {
echo "**git***"
if [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" == "true" ]; then
git log --decorate -n 1
echo "**git submodules***"
git submodule status --recursive
else
echo "Not inside a git repository"
fi
Expand All @@ -27,19 +30,19 @@ lscpu
echo

echo "***CMake***"
which cmake && cmake --version
which cmake && cmake --version
echo

echo "***g++***"
which g++ && g++ --version
which g++ && g++ --version
echo

echo "***nvcc***"
which nvcc && nvcc --version
which nvcc && nvcc --version
echo

echo "***Python***"
which python && python --version
which python && python -c "import sys; print('Python {0}.{1}.{2}'.format(sys.version_info[0], sys.version_info[1], sys.version_info[2]))"
echo

echo "***Environment Variables***"
Expand All @@ -62,7 +65,7 @@ echo
# Print conda packages if conda exists
if type "conda" &> /dev/null; then
echo '***conda packages***'
which conda && conda list
which conda && conda list
echo
# Print pip packages if pip exists
elif type "pip" &> /dev/null; then
Expand All @@ -74,3 +77,11 @@ else
echo "conda not found"
echo "pip not found"
fi
}

echo "<details><summary>Click here to see environment details</summary><pre>"
echo " "
print_env | while read -r line; do
echo " $line"
done
echo "</pre></details>"

0 comments on commit 55aaa06

Please sign in to comment.