From 01163431b3e6c886243cc6c95afe7a9560529a04 Mon Sep 17 00:00:00 2001 From: d3v53c Date: Thu, 4 Feb 2021 13:10:19 -0800 Subject: [PATCH] change exec -> execFile --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f6bfec7..d81dce1 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -const exec = require('child_process').exec; +const exec = require('child_process').execFile; const COMMANDS = { darwin: 'open', @@ -10,7 +10,7 @@ const command = COMMANDS[process.platform] || 'xdg-open'; module.exports = function xopen(filepath) { return new Promise(function(resolve, reject) { - exec(command + ' ' + filepath, (error, stdout, stderr) => { + exec(command, [filepath], (error, stdout, stderr) => { if (error) { return reject(error); }