()
| 187 | |
| 188 | |
| 189 | def get_ghstack_token(): |
| 190 | pattern = "github_oauth = (.*)" |
| 191 | with open(Path("~/.ghstackrc").expanduser(), "r+") as f: |
| 192 | config = f.read() |
| 193 | matches = re.findall(pattern, config) |
| 194 | if len(matches) == 0: |
| 195 | raise RuntimeError("Can't find a github oauth token") |
| 196 | return matches[0] |
| 197 | |
| 198 | |
| 199 | def get_token(): |