Skip to content

Script for Student "Health Check"#522

Merged
ganning127 merged 3 commits intomainfrom
health-checkup
Sep 10, 2022
Merged

Script for Student "Health Check"#522
ganning127 merged 3 commits intomainfrom
health-checkup

Conversation

@emsesc
Copy link
Copy Markdown
Contributor

@emsesc emsesc commented Jul 24, 2022

Changes made

  • Wrote script that checks node + core tools versions
  • Provides suggestions for fixing

@lechnerc77 I believe this script is compatible with MacOS, Windows, and Linux. Students can run the bash script in Git Bash since they'll have that installed in order to work with Git if they have a Windows system.

Closes #521

@emsesc emsesc requested review from ganning127 and lechnerc77 July 24, 2022 15:09
Comment thread checkup.sh Outdated
then
echo "Node is installed, skipping...";
else
echo "Node is not installed.";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would students need to restart their terminal to see that node is infact installed? I know that sometimes that needs to happen. Maybe add a line saying "If you've installed node but this script is still saying you haven't, please restart your terminal and run the script again"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put that into the output at the very beginning

@lechnerc77
Copy link
Copy Markdown
Collaborator

@emsesc had a first run on Linux and Windows (via Git bash). There are some issues, I will enter them as review comments tomorrow.

Comment thread checkup.sh
Comment thread checkup.sh Outdated
echo "--------------------------------";
echo "Checking if node is installed...";
echo "--------------------------------";
if which node > /dev/null
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leads to a very weird output on git bash on Windows
git-bash-windows. I think we can transform this check into the version check done above => if the variable is empty, no Node.js is installed

Comment thread checkup.sh Outdated
then
echo "Node is installed, skipping...";
else
echo "Node is not installed.";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put that into the output at the very beginning

Comment thread checkup.sh Outdated
if [[ (${nodev:1:2} == "16" || ${nodev:1:2} == "14") && (${funcv:0:1} == "4") ]]
then
echo "Compatible versions! You are good to go.";
elif [[ (${nodev:1:2} == "14" || ${nodev:1:2} == "12" || ${nodev:1:2} == "10") && (${funcv:0:1} == "3") ]]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node.js version 10 and 12 are out of maintenance. They should be excluded; maybe a message might make sense when checking the Node version that those are not supported

@emsesc emsesc requested review from ganning127 and lechnerc77 July 27, 2022 20:15
@emsesc
Copy link
Copy Markdown
Contributor Author

emsesc commented Jul 27, 2022

Thanks for the suggestions @lechnerc77 and @ganning127 ! I've implemented them all.

Comment thread checkup.sh Outdated
echo "--------------------------------";
echo "Checking if node is installed...";
echo "--------------------------------";
if [[ $(node -v) ]]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can use ${nodev} and ${funcv} in the IF-clauses instead of calling node-v again.

Same on line 34

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emsesc Overall looks really good now - also works in Git Bash as expected

Copy link
Copy Markdown
Collaborator

@lechnerc77 lechnerc77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small addition to get rid of another command

@emsesc emsesc requested a review from lechnerc77 July 28, 2022 12:13
@stale
Copy link
Copy Markdown

stale Bot commented Aug 14, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix label Aug 14, 2022
@stale stale Bot removed the wontfix label Sep 10, 2022
@ganning127 ganning127 merged commit 7fd8024 into main Sep 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Health check of system setup for students

3 participants