-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
202 lines (184 loc) · 5.91 KB
/
configure
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#!/bin/bash
echo Marking files as executable...
chmod +x commit
chmod +x push
chmod +x init-repo
chmod +x commit-and-push
chmod +x pull
chmod +x set-cache-credentials
chmod +x set-store-credentials
chmod +x global-set-cache-credentials
chmod +x global-set-store-credentials
chmod +x lib/*
if [ ! -f ".systeminitializedrepobefore" ] && [ ! "$*" == "--norepoconfig" ] || [ "$*" == "--newrepoconfig" ]; then
echo Initializing repo...
./init-repo
echo
echo Do you want to set a remote repository destination?
echo \(this must be manually configured if no was selected, see README for more info\)
echo Make sure you have writing permissions for the repository.
read -p "Do you want to continue [Y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo Configuring remote repository destination...
echo Enter the remote destination url:
read giturl
git remote add repo $giturl
fi
echo
read -p "Do you want to store git credentials for this repository? (less safe than cache, which wipes on every reboot, select no for caching or nothing) [Y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo
./set-store-credentials
else
echo
read -p "Do you want to cache git credentials for this repository? (cache wipes after each restart) [Y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
./set-cache-credentials
fi
echo
fi
echo >> .systeminitializedrepobefore
fi
echo Checking dependencies...
missingdepends=false
requiredvermsbuild=15.6.0.0
requiredvernuget=5.6.0.6591
requiredvermake=4.3
requiredvergit=2.28.0
requiredverdotnet=5.0.205
echo Searching for dotnet...
if command -v dotnet &> /dev/null
then
requiredver=$requiredverdotnet
currentver="$(dotnet --version)"
packagename="DotNet SDK"
installed=false
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then
echo $packagename is installed.
installed=true
else
echo $packagename is installed but OUTDATED, minimal version: $requiredver, current version: $currentver
installed=false
missingdepends=true
fi
dotnetinstalled=$installed
else
echo DotNet SDK Core is NOT installed.
dotnetinstalled=false
missingdepends=true
fi
echo Searching for MSBuild...
if command -v msbuild &> /dev/null
then
requiredver=$requiredvermsbuild
currentver="$(msbuild -version|grep --only-matching --perl-regexp "\\d+\.\\d+\.\\d+\.\\d+")"
packagename=MSBuild
installed=false
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then
echo $packagename is installed.
installed=true
else
echo $packagename is installed but OUTDATED, minimal version: $requiredver, current version: $currentver
installed=false
missingdepends=true
fi
msbuildinstalled=$installed
else
echo MSBuild is NOT installed.
msbuildinstalled=false
missingdepends=true
fi
echo Searching for NuGet...
if command -v nuget &> /dev/null
then
requiredver=$requiredvernuget
currentver="$(nuget|grep --only-matching --perl-regexp "\\d+\.\\d+\.\\d+\.\\d+")"
packagename=NuGet
installed=false
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then
echo $packagename is installed.
installed=true
else
echo $packagename is installed but OUTDATED, minimal version: $requiredver, current version: $currentver
installed=false
missingdepends=true
fi
nugetinstalled=$installed
else
echo NuGet is NOT installed.
nugetinstalled=false
missingdepends=true
fi
echo Searching for make...
if command -v make &> /dev/null
then
requiredver=$requiredvermake
currentver="$(make --version|grep --only-matching --perl-regexp "\\d+\.\\d+")"
packagename=make
installed=false
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then
echo $packagename is installed.
installed=true
else
echo $packagename is installed but OUTDATED, minimal version: $requiredver, current version: $currentver
installed=false
missingdepends=true
fi
makeinstalled=$installed
else
echo make is NOT installed.
makeinstalled=false
missingdepends=true
fi
echo Searching for Git...
if command -v git &> /dev/null
then
requiredver=$requiredvergit
currentver="$(git --version|grep --only-matching --perl-regexp "\\d+\.\\d+\.\\d+")"
packagename=Git
installed=false
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then
echo $packagename is installed.
installed=true
else
echo $packagename is installed but OUTDATED, minimal version: $requiredver, current version: $currentver
installed=false
missingdepends=true
fi
gitinstalled=$installed
else
echo Git is NOT installed.
makeinstalled=false
missingdepends=true
fi
if [ $missingdepends == "false" ]; then
echo
echo Trying to restore packages...
nuget restore -Verbosity quiet
echo
echo If package restore succeeded, run make to compile.
else
echo
echo You are missing the following dependencies:
if [ "$dotnetinstalled" == "false" ]; then
echo Mono version $requiredverdotnet or above.
fi
if [ "$msbuildinstalled" == "false" ]; then
echo MSBuild version $requiredvermsbuild or above.
fi
if [ "$nugetinstalled" == "false" ]; then
echo NuGet version $requiredvernuget or above.
fi
if [ "$makeinstalled" == "false" ]; then
echo Make version $requiredvermake or above.
fi
if [ "$gitinstalled" == "false" ]; then
echo Git version $requiredvergit or above.
fi
exit 1
fi