-
Notifications
You must be signed in to change notification settings - Fork 7
/
make.bat
64 lines (58 loc) · 1.67 KB
/
make.bat
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
@ECHO off
set ip=%1
set INSTALL="install"
set BUILD="build"
set RUN="run"
set TEST="test"
set START="start"
if "%ip%"==%INSTALL% (
echo "Installing Go Dependencies..."
go get
)
if "%ip%"==%BUILD% (
echo ⚒ Initiating gitconvex build for windows
echo 🗑 Cleaning up unwanted folders
rd /s /q ui
rd /s /q dist
rd /s /q build
echo ⏳ Cloning UI package from github gitconvex-ui/master
git clone -q https://github.com/neel1996/gitconvex-ui.git ui/
cd ui
echo ⏳ Installing UI dependencies
del package-lock.json
npm install --silent
echo ⚒ Building UI bundle
set NODE_ENV=production
npm install tailwindcss postcss autoprefixer
npx tailwindcss build -o src/index.css -c src/tailwind.config.js
npm run build
echo 🔹 Moving react bundle to gitconvex-ui
move .\build gitconvex-ui
move .\gitconvex-ui ..\
cd ..
mkdir .\dist
echo 🔹 Moving UI artifacts to dist folder
move .\gitconvex-ui .\dist\
echo 🔹 Copying etc content to dist
xcopy /E /I .\etc\ .\dist\etc\
copy .\etc\git2.dll .\dist\
echo 🔸 Removing intermediary folder ui/
rd /s /q ui
echo 🚀 Building gitconvex bundle
go build -o ./dist/gitconvex.exe
cd .\dist
rename gitconvex-server.exe gitconvex.exe
echo ✅ Gitconvex Build Completed successfully!
echo 📬 Run ./dist/gitconvex.exe to start gitconvex on port 9001
echo 📬 Try ./dist/gitconvex.exe --port PORT_NUMBER to run gitconvex on the desired port
cd ..
)
if "%ip%"==%TEST% (
go test -tags static -v ./...
)
if "%ip%"==%RUN% (
go run server.go
)
if "%ip%"==%START% (
.\dist\gitconvex.exe
)