-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgen.sh
executable file
·50 lines (43 loc) · 1.21 KB
/
gen.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
#!/bin/sh
mkdir $1
cp -r .template/* $1
cd $1
# echo "Replacing YaleOpenLab/opensolar with $1/$2"
find . -name '*.go' -print0 | xargs -0 sed -i "" "s,github.com/YaleOpenLab/create-openx-app/.template,github.com/$1/$2,g"
yes="y"
# echo $3, $4, $6
if [ "$3" == "$yes" ] ; then
echo "Adding extra options for investors"
cd core
rm investor.go
mv investor_voter.gotemp investor.go
else
echo "Deleting extra options for investors"
find . -name '*investor_voter.gotemp' -exec rm "{}" \;
fi
if [ "$4" == "$yes" ] ; then
# ie the person wants to not omit the handlers
echo "Adding extra options for recipients"
else
echo "Deleting extra options for recipients"
find . -name '*recipient_options.go' -exec rm "{}" \;
fi
cd notif
find . -name '*.go' -print0 | xargs -0 sed -i "" "s,REPLACEME,$5,g"
cd ..
if [ "$6" == "$yes" ] ; then
echo "Adding support for other blockchains"
else
echo "Omitting other blockchain handlers"
cd core
rm project.go contract.go
mv project_stellar.gotemp project.go
mv contract_stellar.gotemp contract.go
fi
cd ..
# cd ..
# echo $GOPATH
# mv $1 $GOPATH/
# cd $GOPATH/$1
# go build
# echo "Template moved under GOPATH, please build form there to see if the platform works as expected"