mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-11-16 07:48:01 +01:00
[update] Use .git
folder to distinguish source
/unknown
This is not perfect, but is good enough for how we use this information Closes #3994
This commit is contained in:
parent
0d6bafbfa7
commit
233ad894d3
1 changed files with 2 additions and 1 deletions
|
@ -29,7 +29,8 @@ def _get_variant_and_executable_path():
|
|||
path = os.path.dirname(__file__)
|
||||
if isinstance(__loader__, zipimporter):
|
||||
return 'zip', os.path.join(path, '..')
|
||||
elif os.path.basename(sys.argv[0]) == '__main__.py':
|
||||
elif (os.path.basename(sys.argv[0]) in ('__main__.py', '-m')
|
||||
and os.path.exists(os.path.join(path, '../.git/HEAD'))):
|
||||
return 'source', path
|
||||
return 'unknown', path
|
||||
|
||||
|
|
Loading…
Reference in a new issue