Skip to content

Commit e9d2fe2

Browse files
committed
fix: recognize sh files as text files
1 parent 853059f commit e9d2fe2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ const mime = new Mime(standardMimes, otherMimes).define(
247247
true,
248248
);
249249

250-
// Detect whether file is binary from its MIME type, or if not available, contents
251250
const getSourceFileFormat = (filePath: string, fileContent: Buffer) => {
252251
// Try to detect the MIME type from the file path
253252
const contentType = mime.getType(filePath);
@@ -259,6 +258,7 @@ const getSourceFileFormat = (filePath: string, fileContent: Buffer) => {
259258
contentType.includes('xml') ||
260259
contentType.includes('application/node') || // .cjs files
261260
contentType.includes('application/toml') || // for example pyproject.toml files
261+
contentType.includes('application/x-sh') || // .sh files
262262
contentType.includes('application/x-httpd-php') // .php files
263263
? SOURCE_FILE_FORMATS.TEXT
264264
: SOURCE_FILE_FORMATS.BASE64;

0 commit comments

Comments
 (0)