@iflow-ai/iflow-cli 0.3.24 → 0.3.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iflow-ai/iflow-cli",
3
- "version": "0.3.24",
3
+ "version": "0.3.26",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },
@@ -44,7 +44,7 @@
44
44
  "typecheck": "npm run typecheck --workspaces --if-present",
45
45
  "preflight": "npm run clean && npm ci && npm run format && npm run lint:ci && npm run build && npm run typecheck && npm run test:ci",
46
46
  "prepare": "husky",
47
- "prepack": "npm run bundle",
47
+ "prepack": "git lfs pull && npm run bundle",
48
48
  "prepare:package": "node scripts/prepare-package.js",
49
49
  "release:version": "node scripts/version.js",
50
50
  "telemetry": "node scripts/telemetry.js",
@@ -13,13 +13,33 @@
13
13
  */
14
14
 
15
15
  import { execSync } from 'child_process';
16
- import { existsSync, readdirSync, statSync } from 'fs';
16
+ import { existsSync, readdirSync, statSync, readFileSync } from 'fs';
17
17
  import { join, dirname } from 'path';
18
18
  import { fileURLToPath } from 'url';
19
19
 
20
20
  const __dirname = dirname(fileURLToPath(import.meta.url));
21
21
  const vendorsDir = join(__dirname, '..', 'vendors', 'ripgrep');
22
22
 
23
+ /**
24
+ * Checks if a file is a Git LFS pointer file
25
+ * @param {string} filePath - Path to the file
26
+ * @returns {boolean} True if the file is a Git LFS pointer
27
+ */
28
+ function isGitLFSPointer(filePath) {
29
+ try {
30
+ const stat = statSync(filePath);
31
+ // Git LFS pointers are small text files (usually < 200 bytes)
32
+ if (stat.size > 500) {
33
+ return false;
34
+ }
35
+
36
+ const content = readFileSync(filePath, 'utf8');
37
+ return content.startsWith('version https://git-lfs.github.com/spec/');
38
+ } catch {
39
+ return false;
40
+ }
41
+ }
42
+
23
43
  /**
24
44
  * Removes problematic extended attributes from a file on macOS
25
45
  * This includes quarantine and cache attributes that can cause ENOEXEC
@@ -68,6 +88,7 @@ function processRipgrepBinaries(dir) {
68
88
  }
69
89
 
70
90
  const entries = readdirSync(dir);
91
+ let hasGitLFSPointers = false;
71
92
 
72
93
  for (const entry of entries) {
73
94
  const fullPath = join(dir, entry);
@@ -77,10 +98,34 @@ function processRipgrepBinaries(dir) {
77
98
  // Recurse into subdirectories
78
99
  processRipgrepBinaries(fullPath);
79
100
  } else if (entry === 'rg' || entry === 'rg.exe') {
80
- // Found a ripgrep binary
81
- removeQuarantineAttribute(fullPath);
101
+ // Check if this is a Git LFS pointer file
102
+ if (isGitLFSPointer(fullPath)) {
103
+ console.error(
104
+ ` ✗ Error: ${fullPath} is a Git LFS pointer file, not a real binary!`,
105
+ );
106
+ console.error(
107
+ ` This will cause ENOEXEC errors when trying to execute ripgrep.`,
108
+ );
109
+ console.error(
110
+ ` Please ensure Git LFS is installed and run: git lfs pull`,
111
+ );
112
+ hasGitLFSPointers = true;
113
+ } else {
114
+ // Found a real ripgrep binary
115
+ removeQuarantineAttribute(fullPath);
116
+ }
82
117
  }
83
118
  }
119
+
120
+ if (hasGitLFSPointers) {
121
+ console.error(
122
+ '\n⚠️ WARNING: Some ripgrep binaries are Git LFS pointer files.',
123
+ );
124
+ console.error(
125
+ ' The search functionality will not work until these are replaced with real binaries.',
126
+ );
127
+ console.error(' To fix this, run: git lfs install && git lfs pull\n');
128
+ }
84
129
  }
85
130
 
86
131
  // Main execution