We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
//go:gen
1 parent b0758fd commit 0dfd336Copy full SHA for 0dfd336
go/gen.py
@@ -1,11 +1,17 @@
1
import sys
2
import pathlib
3
import subprocess
4
+import os
5
from python.runfiles import runfiles
6
-this = pathlib.Path(__file__).resolve()
7
-go_extractor_dir = this.parent / "extractor"
8
-go_dbscheme = this.parent / "ql" / "lib" / "go.dbscheme"
+try:
+ workspace_dir = pathlib.Path(os.environ['BUILD_WORKSPACE_DIRECTORY'])
9
+except KeyError:
10
+ print("this should be run with bazel run", file=sys.stderr)
11
+ sys.exit(1)
12
+
13
+go_extractor_dir = workspace_dir / "go" / "extractor"
14
+go_dbscheme = workspace_dir / "go" / "ql" / "lib" / "go.dbscheme"
15
r = runfiles.Create()
16
go, gazelle, go_gen_dbscheme = map(r.Rlocation, sys.argv[1:])
17
0 commit comments