-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.bat
66 lines (58 loc) · 1.3 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
65
66
@ECHO OFF
set PWD=%~dp0
set COMMAND=%1
if X%COMMAND%==X set COMMAND=all
if X%COMMAND%==Xhelp goto Help
if X%COMMAND%==Xclean goto Clean
if X%COMMAND%==Xall goto Distro
if X%COMMAND%==Xdistro goto Distro
if X%COMMAND%==Xupload goto Upload
if X%COMMAND%==Xinstall goto Install
if X%COMMAND%==Xuninstall goto UnInstall
goto Help
:Help
echo "Usage: call with args from ['clean', 'all', 'distro', 'upload', 'install', 'uninstall']"
goto End
:Distro
echo.
echo "Building msi installer."
python setup.py bdist_msi
cd ..
if X%COMMAND%==Xall (
goto Upload
) else (
goto End
)
:Upload
echo.
echo "Uploading to file server."
cd dist
scp *.msi files@files.yujinrobot.com:pub/appupdater/python/2.7/
cd ..\..
goto End
:Install
python setup.py install --record installed_files.txt
goto End
:UnInstall
SetLocal EnableDelayedExpansion
set UNINSTALL_FILES=
if exist installed_files.txt (
echo Uninstalling files from the python directories
echo Note: it doesn't clean directories.
for /F "delims=" %%i in (installed_files.txt) do (
set UNINSTALL_FILES=!UNINSTALL_FILES! %%i
)
rem echo !UNINSTALL_FILES!
)
rem Don't know why this won't work inside the if statement.
rm -f %UNINSTALL_FILES%
EndLocal
goto End
:Clean
rd /S /Q %cd%\build
rd /S /Q %cd%\dist
rm -f MANIFEST
rm -f installed_files.txt
goto End
:End
cd %PWD%