@followthecode/cli 1.2.26 → 1.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/linux-x64/ftc.cli +0 -0
- package/bin/osx-x64/ftc.cli +0 -0
- package/bin/win-x64/ftc.cli.exe +0 -0
- package/package.json +1 -1
- package/scripts/post-install.js +53 -0
package/bin/linux-x64/ftc.cli
CHANGED
|
Binary file
|
package/bin/osx-x64/ftc.cli
CHANGED
|
Binary file
|
package/bin/win-x64/ftc.cli.exe
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/scripts/post-install.js
CHANGED
|
@@ -2,9 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const { execSync, spawn } = require('child_process');
|
|
5
6
|
|
|
6
7
|
console.log('🔧 Configurando FTC CLI após instalação...');
|
|
7
8
|
|
|
9
|
+
// Função para verificar e instalar dependências nativas no Linux
|
|
10
|
+
function checkAndInstallNativeDependencies() {
|
|
11
|
+
if (process.platform !== 'linux') {
|
|
12
|
+
console.log('📋 Sistema não é Linux, pulando verificação de dependências nativas');
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
console.log('🔍 Verificando dependências nativas...');
|
|
17
|
+
|
|
18
|
+
try {
|
|
19
|
+
// Verifica se as bibliotecas necessárias estão disponíveis
|
|
20
|
+
const requiredLibs = ['libssl', 'libcurl', 'libz'];
|
|
21
|
+
const missingLibs = [];
|
|
22
|
+
|
|
23
|
+
for (const lib of requiredLibs) {
|
|
24
|
+
try {
|
|
25
|
+
execSync(`ldconfig -p | grep -q "${lib}"`, { stdio: 'pipe' });
|
|
26
|
+
console.log(`✅ ${lib} encontrado`);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
missingLibs.push(lib);
|
|
29
|
+
console.log(`❌ ${lib} não encontrado`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (missingLibs.length > 0) {
|
|
34
|
+
console.log('⚠️ Algumas dependências nativas estão faltando. Tentando instalar...');
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
// Tenta instalar as dependências
|
|
38
|
+
execSync('sudo apt-get update', { stdio: 'inherit' });
|
|
39
|
+
execSync('sudo apt-get install -y libssl-dev libcurl4-openssl-dev zlib1g-dev', { stdio: 'inherit' });
|
|
40
|
+
console.log('✅ Dependências nativas instaladas com sucesso!');
|
|
41
|
+
return true;
|
|
42
|
+
} catch (installError) {
|
|
43
|
+
console.warn('⚠️ Não foi possível instalar dependências automaticamente:', installError.message);
|
|
44
|
+
console.log('💡 Execute manualmente: sudo apt-get install -y libssl-dev libcurl4-openssl-dev zlib1g-dev');
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return true;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.warn('⚠️ Erro ao verificar dependências nativas:', error.message);
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
8
56
|
// Função para copiar arquivo de configuração
|
|
9
57
|
function copyConfigFile() {
|
|
10
58
|
try {
|
|
@@ -67,12 +115,17 @@ function setPermissions() {
|
|
|
67
115
|
}
|
|
68
116
|
|
|
69
117
|
// Executa as configurações
|
|
118
|
+
const nativeDepsSuccess = checkAndInstallNativeDependencies();
|
|
70
119
|
const configSuccess = copyConfigFile();
|
|
71
120
|
const permissionsSuccess = setPermissions();
|
|
72
121
|
|
|
73
122
|
if (configSuccess && permissionsSuccess) {
|
|
74
123
|
console.log('🎉 FTC CLI configurado com sucesso!');
|
|
75
124
|
console.log('💡 Execute: ftc --help');
|
|
125
|
+
|
|
126
|
+
if (!nativeDepsSuccess) {
|
|
127
|
+
console.log('⚠️ Dependências nativas podem precisar de instalação manual');
|
|
128
|
+
}
|
|
76
129
|
} else {
|
|
77
130
|
console.error('❌ Alguns problemas foram encontrados durante a configuração.');
|
|
78
131
|
process.exit(1);
|