Lines Matching +full:shebang +full:- +full:command
3 # Use of this source code is governed by a BSD-style license that can be
24 from .command import quoted, cmd
31 GERRIT_URL = "https://chromium-review.googlesource.com"
35 for line in cmd("git ls-files").lines():
52 def find_scripts(path: Path, shebang: str):
54 if file.is_file() and file.open(errors="ignore").read(512).startswith(f"#!{shebang}"):
66 return cmd("gcloud auth print-access-token").stdout(check=False)
72 Returns a curl `Command` instance set up to use the same HTTP credentials as git.
75 - git cookies (the default)
76 - gcloud
81 If enabled in git, this command will also return a curl command using a gloud access token.
89 return cmd("curl --cookie", cookie_file)
100 return cmd(f"curl -H @{AUTH_HEADERS_FILE}")
106 # See https://gerrit-review.googlesource.com/Documentation/rest-api.html#output
112 response = cmd(f"curl --silent --fail {GERRIT_URL}/{path}").stdout()
118 "--silent --fail",
119 "-X POST",
120 "-H",
121 quoted("Content-Type: application/json"),
122 "-d",
136 https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#change-info
147 def _details(self) -> Any:
151 def _messages(self) -> List[Any]:
158 def get_votes(self, label_name: str) -> List[int]:
164 def get_messages_by(self, email: str) -> List[str]:
192 return f"{self} - {self._data['subject']}"