This repository has been archived by the owner on Jun 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrun.bat
84 lines (74 loc) · 1.69 KB
/
run.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@echo off
TITLE PyStark Batch Script File
@REM HELP
cls
if "%1" == "help" set true=1
if "%1" == "" set true=1
if defined true (
echo Usage: run [delete^|docs^|freeze^|test^|main] [open]
echo.
echo 'test' - upload to test-pypi
echo 'main' - upload to pypi
echo 'docs' - only update docs
echo 'delete' - only delete folders
exit /b 0
)
@REM DELETE
echo [Deleting Unnecessary Folders]
set folder='dist'
rmdir dist /q/s && (
echo Deleted %folder%
) || (
echo Cannot found %folder%
)
set folder2='PyStark.egg-info'
rmdir PyStark.egg-info /q/s && (
echo Deleted %folder2%
) || (
echo Cannot found %folder2%
)
set folder3='docs/_build'
rmdir "docs/_build" /q/s && (
echo Deleted %folder3%
) || (
echo Cannot found %folder3%
)
if "%1" == "delete" exit /b 0
echo.
@REM DIST
echo [Creating Distribution Files]
python setup.py sdist
if "%1" == "dist" exit /b 0
echo.
@REM FREEZE
echo [Freezing Requirements]
pip freeze > frozen-requirements.txt
if "%1" == "freeze" exit /b 0
echo.
@REM TEST/MAIN
if "%1" == "test" goto :test
if "%1" == "main" goto :main
if "%1" == "docs" goto :docs
:test
echo [Upload to TestPyPI]
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
if "%2" == "open" start https://test.pypi.org/project/pystark
echo.
echo [All Done]
exit /b 0
:docs
echo [Deploying Docs]
call mkdocs gh-deploy -m "Deployed {sha} with MkDocs version: {version}"
if "%2" == "open" start https://pystark.codes/
if "%1" == "docs" exit /b 0
echo.
echo [All Done]
exit /b 0
:main
echo [Upload to PyPI]
twine upload dist/*
if "%2" == "open" start https://pypi.org/project/pystark
echo.
echo [All Done]
exit /b 0
@REM To-Do : Create command-line tool using Python/GoLang instead