2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-01 04:10:49 +00:00
nativefier/src/helpers/fsHelpers.ts
Adam Weeden 9330c8434f
Add an option to upgrade an existing app (fix #1131) (PR #1138)
This adds a `--upgrade` option to upgrade-in-place an old app, re-using its options it can.
Should help fix #1131

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-04-28 22:00:31 -04:00

20 lines
376 B
TypeScript

import * as fs from 'fs';
export function dirExists(dirName: string): boolean {
try {
const dirStat = fs.statSync(dirName);
return dirStat.isDirectory();
} catch {
return false;
}
}
export function fileExists(fileName: string): boolean {
try {
const fileStat = fs.statSync(fileName);
return fileStat.isFile();
} catch {
return false;
}
}