MCPcopy Create free account
hub / github.com/angular/dev-infra / __awaiter3

Function __awaiter3

github-actions/browserstack/set-browserstack-env.js:19956–19982  ·  view source on GitHub ↗
(thisArg, _arguments, P, generator)

Source from the content-addressed store, hash-verified

19954 step((generator = generator.apply(thisArg, _arguments || [])).next());
19955 });
19956 };
19957 var { access, appendFile, writeFile } = import_fs.promises;
19958 var SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY";
19959 var Summary = class {
19960 constructor() {
19961 this._buffer = "";
19962 }
19963 /**
19964 * Finds the summary file path from the environment, rejects if env var is not found or file does not exist
19965 * Also checks r/w permissions.
19966 *
19967 * @returns step summary file path
19968 */
19969 filePath() {
19970 return __awaiter(this, void 0, void 0, function* () {
19971 if (this._filePath) {
19972 return this._filePath;
19973 }
19974 const pathFromEnv = process.env[SUMMARY_ENV_VAR];
19975 if (!pathFromEnv) {
19976 throw new Error(`Unable to find environment variable for $${SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);
19977 }
19978 try {
19979 yield access(pathFromEnv, import_fs.constants.R_OK | import_fs.constants.W_OK);
19980 } catch (_a) {
19981 throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);
19982 }
19983 this._filePath = pathFromEnv;
19984 return this._filePath;
19985 });

Callers 2

whichFunction · 0.70
findInPathFunction · 0.70

Calls 3

stepFunction · 0.70
nextMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected