UNPKG

@gluestack-seal/cli

Version:
34 lines (33 loc) 1.78 kB
"use strict"; 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 }); const docker_compose_1 = __importDefault(require("../runners/docker-compose")); const up_1 = require("./up"); const chalk_1 = __importDefault(require("chalk")); // Stops the seal.compose function stopDockerCompose(_yamlContent) { return __awaiter(this, void 0, void 0, function* () { const filepath = process.cwd(); const projectName = _yamlContent.project_name; // starting seal.compose const dockerCompose = new docker_compose_1.default(); yield dockerCompose.stop(projectName, filepath); }); } exports.default = () => __awaiter(void 0, void 0, void 0, function* () { const _yamlContent = yield (0, up_1.getAndValidateSealYaml)(); console.log(`> Stopping ${_yamlContent.project_name}...`); yield stopDockerCompose(_yamlContent); console.log(chalk_1.default.green(`\n${_yamlContent.project_name} is down.\n`)); });