Comments (1)
To exclude binary files in the functions that retrieve files in the repo, you can use the isbinaryfile
package to check if a file is binary or not. Here's how you can do it:
- Install the
isbinaryfile
package by running:
npm install isbinaryfile
- In the
modules/fsInput.js
file, update thegetFilePaths
function as follows:
const { isBinaryFileSync } = require("isbinaryfile");
function getFilePaths(dir) {
const files = fs.readdirSync(dir);
const projectFiles = [];
for (const file of files) {
const filePath = path.posix.join(dir, file);
const stats = fs.statSync(filePath);
if (stats.isDirectory() && !ignoreList.includes(file)) {
projectFiles.push(...getFilePaths(filePath));
} else if (fileExtensionsToProcess.includes(path.extname(filePath))) {
// Check if the file is not a binary file
if (!isBinaryFileSync(filePath)) {
projectFiles.push(filePath);
}
}
}
return projectFiles;
};
By using the isbinaryfile
package, the getFilePaths
function will now exclude binary files when retrieving files in the repo, thus preventing errors caused by processing binary files.
from autopilot.
Related Issues (20)
- Error with node ui -t "FIX_CODE" HOT 2
- No matching files found in the database. Indexing is required. HOT 1
- No matching files found in the database. Indexing is required. HOT 6
- Error processing file. Headers is not defined HOT 1
- limit token usage HOT 1
- Swap to typescript HOT 3
- Github Issues Operations support HOT 3
- Fails to Index CODE_DIR HOT 4
- Missing table "files" HOT 5
- Autopilot suggesting changes to its own files HOT 2
- Autopilot
- I am getting Indexing is required error HOT 3
- source code contain `// comments` will causing JSON Parser Error HOT 2
- 429 Rate Limiting HOT 5
- Add OPENAI_BASE_PATH into env HOT 2
- 中文化这个项目
- SyntaxError: Unterminated string in JSON HOT 1
- TypeError: cookies is not iterable HOT 1
- trigger HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autopilot.