Skip to content

Commit ad99d3e

Browse files
install.py: Only call git on a Git repository (#18441)
1 parent 4307484 commit ad99d3e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/install.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ def main():
9595
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
9696
os.makedirs(target)
9797
copy_emscripten(target)
98-
add_revision_file(target)
98+
if os.path.isdir('.git'):
99+
# Add revision flag only if the source directory is a Git repository
100+
# and not a source archive
101+
add_revision_file(target)
99102
return 0
100103

101104

0 commit comments

Comments
 (0)