FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-scripts/22_git_tag.py at master · linxinzheztev/python-scripts · GitHub
linxinzheztev
/
python-scripts
Public
forked from
realpython/python-scripts
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-scripts
/
22_git_tag.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
14 lines (12 loc) · 401 Bytes
Breadcrumbs
python-scripts
/
22_git_tag.py
Copy path
File metadata and controls
executable file
·
14 lines (12 loc) · 401 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
subprocess
import
sys
if
len
(
sys
.
argv
)
==
3
:
tag
=
sys
.
argv
[
1
]
commit
=
sys
.
argv
[
2
]
command
=
'git tag -a {0} {1} -m "{2}"'
.
format
(
tag
,
commit
,
tag
)
output
=
subprocess
.
check_output
(
command
,
shell
=
True
).
decode
(
'utf-8'
)
subprocess
.
call
(
command
,
shell
=
True
)
subprocess
.
call
(
'git push --tags'
,
shell
=
True
)
else
:
print
(
'usage: tag.py TAG_NAME COMMIT'
)
sys
.
exit
(
1
)
Back
|
FazBrowse Home
|
New Git URL