Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Vladimir
noc
Commits
bcf0b405
Commit
bcf0b405
authored
Apr 28, 2022
by
Andrey Vertiprahov
Committed by
Dmitry Volodin
Apr 28, 2022
Browse files
Add Windows compatible which command.
parent
b7ae4b35
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/version.py
View file @
bcf0b405
...
...
@@ -17,6 +17,9 @@ from noc.config import config
CHANGESET_LEN
=
8
BRAND_PATH
=
config
.
get_customized_paths
(
"BRAND"
,
prefer_custom
=
True
)
WHICH
=
"which"
if
os
.
name
==
"nt"
:
WHICH
=
"where"
class
cachedproperty
(
object
):
...
...
@@ -44,7 +47,7 @@ class Version(object):
"""
if
os
.
path
.
exists
(
".git"
):
with
open
(
os
.
devnull
,
"w"
)
as
null
:
return
subprocess
.
call
([
"which"
,
"git"
],
stdout
=
null
)
==
0
return
subprocess
.
call
([
WHICH
,
"git"
],
stdout
=
null
)
==
0
return
False
@
cachedproperty
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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