From 8a0a99b2cff39d4931fe818726a65278592a9cdc Mon Sep 17 00:00:00 2001 From: jb Date: Thu, 23 Apr 2026 15:02:04 -0300 Subject: [PATCH] feat(cli): changed cli update to new npm way --- src/commands/update-cli.js | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/src/commands/update-cli.js b/src/commands/update-cli.js index bfd83ae..ffe7a15 100644 --- a/src/commands/update-cli.js +++ b/src/commands/update-cli.js @@ -1,35 +1,12 @@ 'use strict'; -var path = require('path'); -var os = require('os'); -var fs = require('fs'); -var fse = require('fs-extra'); var { execSync } = require('child_process'); -var { cloneWithFallback, cleanupTemp } = require('../utils/git'); -var SSH_URL = 'ssh://git@git.davinti.com.br:2222/davinTI/vitruvio-cli.git'; -var HTTPS_URL = 'https://git.davinti.com.br/davinTI/vitruvio-cli.git'; - -var INSTALL_DIR = path.join(os.homedir(), '.local', 'share', 'vitruvio-cli'); +var NPM_URL = 'git+https://gitea.vitruvio.com.br/davinti/vitruvio-cli.git'; function run() { console.log(' Buscando versão mais recente do Vitruvio CLI...'); - - var tmpDir = cloneWithFallback(SSH_URL, HTTPS_URL); - - try { - if (fs.existsSync(INSTALL_DIR)) fse.removeSync(INSTALL_DIR); - fse.copySync(tmpDir, INSTALL_DIR); - } finally { - cleanupTemp(tmpDir); - } - - console.log(' Instalando dependências...'); - execSync('npm install', { cwd: INSTALL_DIR, stdio: 'inherit' }); - - console.log(' Vinculando comando vitruvio...'); - try { execSync('npm unlink -g vitruvio', { stdio: 'pipe' }); } catch (_) {} - execSync('npm link', { cwd: INSTALL_DIR, stdio: 'inherit' }); + execSync('npm install -g ' + NPM_URL, { stdio: 'inherit' }); } module.exports = { run: run };