mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-05-20 22:25:50 +08:00
@@ -8,10 +8,9 @@ function basename(filePath) {
|
|||||||
// 检查路径是否存在
|
// 检查路径是否存在
|
||||||
function pathExists(path) {
|
function pathExists(path) {
|
||||||
try {
|
try {
|
||||||
const entries = file.readPathSync(path); // 尝试读取路径内容
|
return file.isFolder(path);
|
||||||
return entries !== undefined && entries.length >= 0;
|
} catch {
|
||||||
} catch (error) {
|
return false;
|
||||||
return false; // 如果读取失败,返回 false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user