Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
yaq
yaqd-gdrive
Commits
5f8377e7
Commit
5f8377e7
authored
Jun 29, 2020
by
Blaise Thompson
Browse files
Update __version__.py
parent
2a4161e0
Pipeline
#161265994
failed with stage
in 1 minute and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
yaqd_gdrive/__version__.py
yaqd_gdrive/__version__.py
+10
-11
No files found.
yaqd_gdrive/__version__.py
View file @
5f8377e7
...
...
@@ -2,6 +2,7 @@
import
pathlib
import
subprocess
here
=
pathlib
.
Path
(
__file__
).
resolve
().
parent
...
...
@@ -14,16 +15,14 @@ __all__ = ["__version__", "__branch__"]
with
open
(
str
(
here
/
"VERSION"
))
as
f
:
__version__
=
f
.
read
().
strip
()
try
:
__branch__
=
(
subprocess
.
run
([
"git"
,
"branch"
,
"--show-current"
],
capture_output
=
True
,
cwd
=
here
)
.
stdout
.
strip
()
.
decode
()
)
except
:
__branch__
=
""
# add git branch, if appropriate
p
=
here
.
parent
/
".git"
if
p
.
is_file
():
with
open
(
str
(
p
))
as
f
:
p
=
p
.
parent
/
f
.
readline
()[
8
:].
strip
()
# Strip "gitdir: "
p
=
p
/
"HEAD"
if
p
.
exists
():
with
open
(
str
(
p
))
as
f
:
__branch__
=
f
.
readline
().
rstrip
().
split
(
r
"/"
)[
-
1
]
if
__branch__
:
__version__
+=
"+"
+
__branch__
else
:
__branch__
=
""
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment