UNPKG

steadybit

Version:

Command-line interface to interact with the Steadybit API

33 lines 1.63 kB
"use strict"; // SPDX-License-Identifier: MIT // SPDX-FileCopyrightText: 2022 Steadybit GmbH var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getExperiment = getExperiment; const js_yaml_1 = __importDefault(require("js-yaml")); const files_1 = require("./files"); const api_1 = require("./api"); function getExperiment(options) { return __awaiter(this, void 0, void 0, function* () { const experiment = yield (0, api_1.fetchExperiment)(options.key); if (!options.file) { console.log(js_yaml_1.default.dump(experiment)); } else { yield (0, files_1.writeYamlFile)(options.file, experiment); console.log('Experiment %s written to %s.', options.key, options.file); } }); } //# sourceMappingURL=get.js.map