-
Notifications
You must be signed in to change notification settings - Fork 7
/
helpers.sh
55 lines (46 loc) · 1.02 KB
/
helpers.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
function testTemplate() {
dotnet pack -o build
local res=$?
if [ "$res" -eq "0" ]; then
# if this fails it's likely just because the template isn't installed
dotnet new -u Criipto.Templates
templateProject=$(ls ./build/*.* | grep Criipto)
res=$?
else
echo "pack failed"
fi
if [ "$res" -eq "0" ]; then
dotnet new -i $templateProject
res=$?
fi
name=$1
if [ -z "$name" ]; then
name="Feliz"
fi
if [ "$res" -eq "0" ]; then
templateDir="deployment-"$name"-source"
mkdir $srcDir
cd $srcDir
dotnet new "Criipto${name}Sample" --force
res=$?
cd -
fi
if [ "$res" -eq "0" ]; then
cd $srcDir/src
dotnet paket update
res=$?
cd -
fi
if [ "$res" -eq "0" ]; then
cd $srcDir
npm install
res=$?
cd -
fi
if [ "$res" -eq "0" ]; then
cd $srcDir
npm run build
res=$?
cd -
fi
}