From e8ab329f60c3e9e5c9cc68784cd465a14ec500bd Mon Sep 17 00:00:00 2001 From: Julian Vassev Date: Wed, 1 Jul 2020 08:51:55 +0300 Subject: [PATCH] Exec with explicit shell This makes it possible to use it on mounts with the noexec option. --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index b7c6a9a..2192fee 100644 --- a/index.ts +++ b/index.ts @@ -521,7 +521,7 @@ export class RotatingFileStream extends Writable { this.findName(true, (error: Error, found: string): void => { if(error) return callback(error); - this.fsOpen(found, "w", parseInt("777", 8), (error: Error, fd: number): void => { + this.fsOpen(found, "w", 0o777, (error: Error, fd: number): void => { if(error) return callback(error); const unlink = (error: Error): void => { @@ -544,7 +544,7 @@ export class RotatingFileStream extends Writable { if(found.indexOf(sep) === -1) found = `.${sep}${found}`; - this.exec(found, unlink); + this.exec(`sh "${found}"`, unlink); }); }); });