Switch fs.statSync to fs.accessSync, which is faster
This commit is contained in:
@@ -147,12 +147,14 @@ function isPortable () {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
let portablePathExists = false
|
|
||||||
try {
|
try {
|
||||||
portablePathExists = !!fs.statSync(PORTABLE_PATH)
|
// This line throws if the "Portable Settings" folder does not exist, and does
|
||||||
} catch (err) {}
|
// nothing otherwise.
|
||||||
|
fs.accessSync(PORTABLE_PATH, fs.constants.R_OK | fs.constants.W_OK)
|
||||||
return portablePathExists
|
return true
|
||||||
|
} catch (err) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isProduction () {
|
function isProduction () {
|
||||||
|
|||||||
Reference in New Issue
Block a user