generated from bitprj/cabin
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathcheckup.sh
executable file
·67 lines (63 loc) · 2.76 KB
/
checkup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
nodev=$(node -v);
funcv=$(func -v);
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."
echo "\n"
echo "--------------------------------";
echo "Checking if node is installed...";
echo "--------------------------------";
if [[ $nodev ]]
then
if [[ ${nodev:1:2} -lt 14 ]]
then
echo "❗️ Your node version is $nodev, which is out of maintenance.";
echo "Please upgrade your node version to at least version 14.x";
echo "https://nodejs.org/en/download/";
echo "Run this script again after to continue.";
exit
else
echo "✅ Node $nodev is installed, skipping...";
fi
else
echo "❗️ Node is not installed.";
echo "Please install node here: https://nodejs.org/en/download/";
echo "Run this script again after to continue.";
exit
fi
echo "\n"
echo "------------------------------------------------------";
echo "Checking if Azure Functions Core Tools is installed...";
echo "------------------------------------------------------";
if [[ $funcv ]]
then
if [[ ${funcv:0:1} < 3 ]]
then
echo "❗️ Please upgrade your Azure Functions Core Tools version to version 4.";
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";
echo "Run this script again after to continue.";
exit
fi
echo "✅ Azure Function Core Tools v$funcv is installed, skipping...";
else
echo "❌ Azure Function Core Tools is not installed.";
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";
echo "Run this script again after to continue.";
exit
fi
echo "\n"
echo "---------------------------------------"
echo "Checking if versions are compatible..."
echo "---------------------------------------"
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") && (${funcv:0:1} == "3") ]]
then
echo "✅ Compatible versions! You are good to go.";
elif [[ ${funcv:0:1} == "3" ]]
then
echo "❗️ Your node version is $nodev but your Azure Core Tools version is $funcv";
echo "Please upgrade your Azure Core Tools version to version 4.x";
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";
echo "Run this script again after to continue.";
fi