You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
first of all, thanks a lot for this cool package.
I've been struggling for the past hour over something that I thought would be pretty simple... running a script using electron sudo, rather than just a command.
All of my attempts not only do nothing but the callbacks returns this error:
Unhandled rejection TypeError: cp.output.stdout is not a function
at /Library/WebServer/Documents/Upwork/download_booster/boostum-electron/main.js:158:15
at tryCatcher (/Library/WebServer/Documents/Upwork/download_booster/boostum-electron/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Library/WebServer/Documents/Upwork/download_booster/boostum-electron/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/Library/WebServer/Documents/Upwork/download_booster/boostum-electron/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/Library/WebServer/Documents/Upwork/download_booster/boostum-electron/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/Library/WebServer/Documents/Upwork/download_booster/boostum-electron/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/Library/WebServer/Documents/Upwork/download_booster/boostum-electron/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Library/WebServer/Documents/Upwork/download_booster/boostum-electron/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Library/WebServer/Documents/Upwork/download_booster/boostum-electron/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)
Here's what I tried:
Os: macOS Sierra,
electron version: 2.0.2
electron-sudo version: 4.0.12
//startup code
var Sudoer = require('electron-sudo').default,
sudo = new Sudoer({}),
script_path = path.join(__dirname, "external", "shutdown.sh");
//I've also tried: script_path = path.join("external", "shutdown.sh");
//these were some of my attempts. I probably tried a couple others, but can't remember them right now
sudo.spawn('sh', ['$PARAM'], {env: {PARAM: script_path}})
.then(function (cp) { //I used the same callback for all of them
cp.output.stdout (Buffer) //I didn't write it here to keep is concise
cp.output.stderr (Buffer)
});
sudo.spawn('sh', [script_path], {}).then(function (cp) {});
sudo.spawn('sh', [script_path]).then(function (cp) {});
sudo.spawn(script_path, [], {}).then(function (cp) {});
the prompt screen appears and then... nothing. The script is supposed to wait until there is content in a particular file and, when there is, shutdown my computer.
I checked several times after turning the system on and there is content.
I've run the script independently and it works. I'm not sure if it's relevant, but here it is, anyway...
while [ ! -s external/shutdown_commander.txt ]; do
sleep 5
done
> external/shutdown_commander.txt
shutdown -h now
The text was updated successfully, but these errors were encountered:
Hi!
first of all, thanks a lot for this cool package.
I've been struggling for the past hour over something that I thought would be pretty simple... running a script using electron sudo, rather than just a command.
All of my attempts not only do nothing but the callbacks returns this error:
Here's what I tried:
Os: macOS Sierra,
electron version: 2.0.2
electron-sudo version: 4.0.12
the prompt screen appears and then... nothing. The script is supposed to wait until there is content in a particular file and, when there is, shutdown my computer.
I checked several times after turning the system on and there is content.
I've run the script independently and it works. I'm not sure if it's relevant, but here it is, anyway...
The text was updated successfully, but these errors were encountered: