From 943aafd944400c26e1ef930faa26a30139f7e586 Mon Sep 17 00:00:00 2001 From: Joey Payne Date: Fri, 31 Jul 2015 11:56:49 -0600 Subject: [PATCH] Chmod only if file exists. --- php-webkit/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/php-webkit/main.js b/php-webkit/main.js index c8e3e15..01ac665 100644 --- a/php-webkit/main.js +++ b/php-webkit/main.js @@ -27,9 +27,11 @@ var phpwebkit = { bin = 'php-cgi'; } } - - // set the permissions to be able to execute - fs.chmodSync(process.cwd() + bin.slice(1), 0755); + var path = process.cwd() + bin.slice(1); + if(fs.existsSync(path)){ + // set the permissions to be able to execute + fs.chmodSync(path, 0755); + } this.fileExists(bin, function(result){ if(result === false) {