UNPKG

totvs-dtsenv-cli

Version:

TOTVS Datasul Environment Command Line

28 lines (27 loc) 1.25 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const CommandUtils_1 = __importDefault(require("../utils/CommandUtils")); class PullCommand { constructor(commander) { commander.command('pull') .description('Atualiza um ambiente Datasul configurado.') .action(PullCommand.actionCommand); PullCommand.program = commander; } static actionCommand() { console.log("Atualizando o ambiente..."); /** Atualizando o ambiente */ let cmd = CommandUtils_1.default.execCommandSync('docker-compose', ['pull']); console.log("Atualizando a pasta Scripts"); let scriptProject = "datasul\\scripts"; cmd = CommandUtils_1.default.execCommandSync('Xcopy', ['/S', '/I', '/E', '/Y', '/Q', '\\\\jv-fwk-dev02\\docker\\projects\\datasul\\scripts', scriptProject + "\\"]); if (cmd.indexOf("112", 0) >= 0) { console.log("Pasta de Scripts copiada com sucesso!"); } console.log("Ambiente atualizado com sucesso."); } } exports.default = PullCommand;