Add check for EACCES too

on Ubuntu EACCES will be thrown
pull/658/head
Mikael Finstad 2021-02-06 23:03:36 +01:00
rodzic a319782a1e
commit d45327b1a3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 25AB36E3E81CBC26
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -78,8 +78,8 @@ export async function checkDirWriteAccess(dirPath) {
try {
await fs.access(dirPath, fs.constants.W_OK);
} catch (err) {
if (err.code === 'EPERM') return false;
// if (err.code === 'EACCES') return false;
if (err.code === 'EPERM') return false; // Thrown on Mac (MAS build) when user has not yet allowed access
if (err.code === 'EACCES') return false; // Thrown on Linux when user doesn't have access to output dir
console.error(err);
}
return true;