This commit is contained in:
Your Name
2024-02-16 17:44:38 -06:00
parent be57e96588
commit 0d8e764b7b

View File

@@ -7,12 +7,14 @@ const socketPath = '/tmp/oscar_watcher.sock';
let progvars = {};
// Remove the socket file if it already exists
try {
fs.unlinkSync(socketPath);
} catch (err) {
if (err.code !== 'ENOENT') {
console.error('Error removing existing socket file:', err);
process.exit(1);
if (fs.existsSync( socketPath )) {
try {
fs.unlinkSync(socketPath);
} catch (err) {
if (err.code !== 'ENOENT') {
console.error('Error removing existing socket file:', err);
process.exit(1);
}
}
}