@followthecode/cli 1.2.16 → 1.2.18

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.
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@followthecode/cli",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
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,77 @@
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
+ // Função principal
63
+ function main() {
64
+ try {
65
+ const version = getPackageVersion();
66
+ console.log(`📦 Versão do package.json: ${version}`);
67
+
68
+ updateCsprojVersion(version);
69
+
70
+ console.log('🎉 Sincronização concluída!');
71
+ } catch (error) {
72
+ console.error('❌ Erro ao sincronizar versões:', error.message);
73
+ process.exit(1);
74
+ }
75
+ }
76
+
77
+ main();