@followthecode/cli 1.2.16 → 1.2.22
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 +4 -2
- package/scripts/sync-version.js +93 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@followthecode/cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.22",
|
|
4
4
|
"description": "CLI tool for Git repository analysis and data collection",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"build:win": "dotnet publish ftc.cli.csproj -c Release -r win-x64 -o ./bin/win-x64",
|
|
18
18
|
"build:mac": "dotnet publish ftc.cli.csproj -c Release -r osx-x64 -o ./bin/osx-x64",
|
|
19
19
|
"build:linux": "dotnet publish ftc.cli.csproj -c Release -r linux-x64 -o ./bin/linux-x64",
|
|
20
|
-
"setup": "npm run copy-config && npm run set-permissions",
|
|
20
|
+
"setup": "npm run sync-version && npm run copy-config && npm run set-permissions",
|
|
21
|
+
"sync-version": "node scripts/sync-version.js",
|
|
21
22
|
"copy-config": "node scripts/copy-config.js",
|
|
22
23
|
"set-permissions": "node scripts/set-permissions.js",
|
|
23
24
|
"postinstall": "node scripts/post-install.js",
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
"bin/linux-x64/appsettings.json",
|
|
77
78
|
"bin/linux-x64/libgit2-c058aa8.so",
|
|
78
79
|
"appsettings.json",
|
|
80
|
+
"scripts/sync-version.js",
|
|
79
81
|
"scripts/copy-config.js",
|
|
80
82
|
"scripts/set-permissions.js",
|
|
81
83
|
"scripts/install-wrapper.js",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
console.log('🔄 Sincronizando versões...');
|
|
7
|
+
|
|
8
|
+
// Lê a versão do package.json
|
|
9
|
+
function getPackageVersion() {
|
|
10
|
+
const packagePath = path.join(__dirname, '..', 'package.json');
|
|
11
|
+
const package = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
|
|
12
|
+
return package.version;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Atualiza a versão no ftc.cli.csproj
|
|
16
|
+
function updateCsprojVersion(version) {
|
|
17
|
+
const csprojPath = path.join(__dirname, '..', 'ftc.cli.csproj');
|
|
18
|
+
let content = fs.readFileSync(csprojPath, 'utf8');
|
|
19
|
+
|
|
20
|
+
// Atualiza as tags de versão
|
|
21
|
+
content = content.replace(
|
|
22
|
+
/<Version>.*?<\/Version>/g,
|
|
23
|
+
`<Version>${version}</Version>`
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
content = content.replace(
|
|
27
|
+
/<AssemblyVersion>.*?<\/AssemblyVersion>/g,
|
|
28
|
+
`<AssemblyVersion>${version}.0</AssemblyVersion>`
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
content = content.replace(
|
|
32
|
+
/<FileVersion>.*?<\/FileVersion>/g,
|
|
33
|
+
`<FileVersion>${version}.0</FileVersion>`
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
// Se as tags não existem, adiciona após UserSecretsId
|
|
37
|
+
if (!content.includes('<Version>')) {
|
|
38
|
+
content = content.replace(
|
|
39
|
+
/(<UserSecretsId>.*?<\/UserSecretsId>)/,
|
|
40
|
+
`$1\n <Version>${version}</Version>`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!content.includes('<AssemblyVersion>')) {
|
|
45
|
+
content = content.replace(
|
|
46
|
+
/(<Version>.*?<\/Version>)/,
|
|
47
|
+
`$1\n <AssemblyVersion>${version}.0</AssemblyVersion>`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!content.includes('<FileVersion>')) {
|
|
52
|
+
content = content.replace(
|
|
53
|
+
/(<AssemblyVersion>.*?<\/AssemblyVersion>)/,
|
|
54
|
+
`$1\n <FileVersion>${version}.0</FileVersion>`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
fs.writeFileSync(csprojPath, content);
|
|
59
|
+
console.log(`✅ Versão ${version} sincronizada no ftc.cli.csproj`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Atualiza a versão no Program.cs
|
|
63
|
+
function updateProgramVersion(version) {
|
|
64
|
+
const programPath = path.join(__dirname, '..', 'Program.cs');
|
|
65
|
+
let content = fs.readFileSync(programPath, 'utf8');
|
|
66
|
+
|
|
67
|
+
// Atualiza a versão no Console.WriteLine do comando version
|
|
68
|
+
content = content.replace(
|
|
69
|
+
/Console\.WriteLine\(".*?"\)/g,
|
|
70
|
+
`Console.WriteLine("${version}")`
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
fs.writeFileSync(programPath, content);
|
|
74
|
+
console.log(`✅ Versão ${version} sincronizada no Program.cs`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Função principal
|
|
78
|
+
function main() {
|
|
79
|
+
try {
|
|
80
|
+
const version = getPackageVersion();
|
|
81
|
+
console.log(`📦 Versão do package.json: ${version}`);
|
|
82
|
+
|
|
83
|
+
updateCsprojVersion(version);
|
|
84
|
+
updateProgramVersion(version);
|
|
85
|
+
|
|
86
|
+
console.log('🎉 Sincronização concluída!');
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error('❌ Erro ao sincronizar versões:', error.message);
|
|
89
|
+
process.exit(1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
main();
|