UNPKG

2.15 kBJavaScriptView Raw
1"use strict";
2/*
3 * Copyright © 2018 Atomist, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18 return new (P || (P = Promise))(function (resolve, reject) {
19 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21 function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
22 step((generator = generator.apply(thisArg, _arguments || [])).next());
23 });
24};
25Object.defineProperty(exports, "__esModule", { value: true });
26/**
27 * Is this SDM in local mode?
28 * Invoked on client startup.
29 */
30function isInLocalMode() {
31 return process.env.ATOMIST_MODE === "local";
32}
33exports.isInLocalMode = isInLocalMode;
34/**
35 * Is this SDM running in local mode?
36 */
37exports.IsInLocalMode = {
38 name: "IsInLocalMode",
39 mapping: () => __awaiter(this, void 0, void 0, function* () { return isInLocalMode(); }),
40};
41/**
42 * Is this SDM running as a GitHub action?
43 * Invoked on client startup.
44 */
45function isGitHubAction() {
46 return !!process.env.GITHUB_WORKFLOW && !!process.env.GITHUB_ACTION && !!process.env.GITHUB_WORKSPACE;
47}
48exports.isGitHubAction = isGitHubAction;
49/**
50 * Is this SDM running as a GitHub action?
51 */
52exports.IsGitHubAction = {
53 name: "IsGitHubAction",
54 mapping: () => __awaiter(this, void 0, void 0, function* () { return isGitHubAction(); }),
55};
56//# sourceMappingURL=modes.js.map
\No newline at end of file