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')) {
|
if (filePath.endsWith('.json')) {
|
||||||
return filePath;
|
return filePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filePath.endsWith('.ts')) {
|
if (!filePath.endsWith('.ts')) {
|
||||||
try {
|
try {
|
||||||
fs.statSync(filePath);
|
fs.statSync(filePath); // its a directory, now try index.ts and index.js
|
||||||
filePath += '/index.ts';
|
try {
|
||||||
|
fs.statSync(filePath + '/index.ts');
|
||||||
|
filePath += '/index.ts';
|
||||||
|
} catch (e) {
|
||||||
|
fs.statSync(filePath + '/index.js');
|
||||||
|
filePath += '/index.js';
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
try {
|
try {
|
||||||
fs.statSync(filePath + '.ts');
|
fs.statSync(filePath + '.ts');
|
||||||
@@ -20,6 +27,7 @@ const addExtension = filePath => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return filePath;
|
return filePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user