1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 08:19:13 +00:00

[infra] Fix default path to git directory when running GN

This should fix the tools/get_dot_git_folder.py script when
running the Debian package build from a source tarball.

Change-Id: I703fa34bbb6c73763c385e7d05b130091a131ade
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191401
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
William Hesse 2021-03-16 16:58:49 +00:00
parent 00b6a815d9
commit e900b9c090
2 changed files with 8 additions and 6 deletions

View File

@ -20,7 +20,10 @@ declare_args() {
# file under the git worktree folder.
# The script run here should take care of everything automatically though.
default_git_folder = exec_script("$_dart_root/tools/get_dot_git_folder.py",
[ rebase_path("$_dart_root/.git") ],
[
rebase_path("$_dart_root/.git"),
"$_dart_root/.git",
],
"trim string")
# Whether to enable the SDK hash check that will prevent loading a kernel

View File

@ -14,9 +14,8 @@ import utils
def main():
try:
if len(sys.argv) != 2:
raise Exception('Expects exactly 1 argument.')
if len(sys.argv) != 3:
raise Exception('Expects exactly 2 arguments.')
args = ['git', 'rev-parse', '--resolve-git-dir', sys.argv[1]]
windows = utils.GuessOS() == 'win32'
@ -40,8 +39,8 @@ def main():
print(outs.strip())
except:
# Fall-back to ".git".
print(".git")
# Fall back to fall-back path.
print(sys.argv[2])
if __name__ == '__main__':