mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 12:57:46 +00:00
Fix internal-dependency-trace script by handling commands/secrets/index.js (#10599)
This commit is contained in:
@@ -6,10 +6,17 @@ const addExtension = filePath => {
|
||||
if (filePath.endsWith('.json')) {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
if (!filePath.endsWith('.ts')) {
|
||||
try {
|
||||
fs.statSync(filePath);
|
||||
filePath += '/index.ts';
|
||||
fs.statSync(filePath); // its a directory, now try index.ts and index.js
|
||||
try {
|
||||
fs.statSync(filePath + '/index.ts');
|
||||
filePath += '/index.ts';
|
||||
} catch (e) {
|
||||
fs.statSync(filePath + '/index.js');
|
||||
filePath += '/index.js';
|
||||
}
|
||||
} catch (e) {
|
||||
try {
|
||||
fs.statSync(filePath + '.ts');
|
||||
@@ -20,6 +27,7 @@ const addExtension = filePath => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return filePath;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user