Skip to content

Commit 7fd8024

Browse files
authored
Merge pull request #522 from bitprj/health-checkup
Script for Student "Health Check"
2 parents 9c829d1 + 9b7cd52 commit 7fd8024

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

checkup.sh

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/bin/bash
2+
3+
nodev=$(node -v);
4+
funcv=$(func -v);
5+
6+
echo "🛑 Note: If you've installed node and Azure Functions Core Tools but this script is still saying you haven't, please restart your terminal and run the script again."
7+
echo "\n"
8+
echo "--------------------------------";
9+
echo "Checking if node is installed...";
10+
echo "--------------------------------";
11+
if [[ $nodev ]]
12+
then
13+
if [[ ${nodev:1:2} -lt 14 ]]
14+
then
15+
echo "❗️ Your node version is $nodev, which is out of maintenance.";
16+
echo "Please upgrade your node version to at least version 14.x";
17+
echo "https://nodejs.org/en/download/";
18+
echo "Run this script again after to continue.";
19+
exit
20+
else
21+
echo "✅ Node $nodev is installed, skipping...";
22+
fi
23+
else
24+
echo "❗️ Node is not installed.";
25+
echo "Please install node here: https://nodejs.org/en/download/";
26+
echo "Run this script again after to continue.";
27+
exit
28+
fi
29+
30+
echo "\n"
31+
echo "------------------------------------------------------";
32+
echo "Checking if Azure Functions Core Tools is installed...";
33+
echo "------------------------------------------------------";
34+
if [[ $funcv ]]
35+
then
36+
if [[ ${funcv:0:1} < 3 ]]
37+
then
38+
echo "❗️ Please upgrade your Azure Functions Core Tools version to version 4.";
39+
echo "Follow this link to learn how to: https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Clinux%2Ccsharp%2Cportal%2Cbash#changing-core-tools-versions";
40+
echo "Run this script again after to continue.";
41+
exit
42+
fi
43+
echo "✅ Azure Function Core Tools v$funcv is installed, skipping...";
44+
else
45+
echo "❌ Azure Function Core Tools is not installed.";
46+
echo "Please install it here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Clinux%2Ccsharp%2Cportal%2Cbash#install-the-azure-functions-core-tools";
47+
echo "Run this script again after to continue.";
48+
exit
49+
fi
50+
51+
echo "\n"
52+
echo "---------------------------------------"
53+
echo "Checking if versions are compatible..."
54+
echo "---------------------------------------"
55+
if [[ (${nodev:1:2} == "16" || ${nodev:1:2} == "14") && (${funcv:0:1} == "4") ]]
56+
then
57+
echo "✅ Compatible versions! You are good to go.";
58+
elif [[ (${nodev:1:2} == "14") && (${funcv:0:1} == "3") ]]
59+
then
60+
echo "✅ Compatible versions! You are good to go.";
61+
elif [[ ${funcv:0:1} == "3" ]]
62+
then
63+
echo "❗️ Your node version is $nodev but your Azure Core Tools version is $funcv";
64+
echo "Please upgrade your Azure Core Tools version to version 4.x";
65+
echo "Follow this link to learn how to: https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local?tabs=v4%2Clinux%2Ccsharp%2Cportal%2Cbash#changing-core-tools-versions";
66+
echo "Run this script again after to continue.";
67+
fi

0 commit comments

Comments
 (0)