Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on macox can show the prompt dialog, but no effect for 'touch /ect/baby' command #68

Open
chaserstrong opened this issue Sep 18, 2019 · 2 comments

Comments

@chaserstrong
Copy link

on macox 10.13.4 (17E199) can show the prompt dialog, but no effect for 'touch /etc/baby' command. I doesn't find baby file in folder etc.
I don't know why #60 was closed. But i have this issue recently.

@t1gor
Copy link

t1gor commented Nov 11, 2020

I guess I might be having a similar issue - spawn call for dialog, I enter password and then I get the following error:

Unhandled rejection TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
[electron]     at from (<anonymous>)
[electron]     at e.default (~/Project/node_modules/electron-sudo/dist/index.js:1:7200)
[electron]     at e.<anonymous> (~/Project/node_modules/electron-sudo/dist/index.js:1:17581)
[electron]     at tryCatch (~/Project/node_modules/regenerator-runtime/runtime.js:63:40)
[electron]     at Generator.invoke [as _invoke] (~/Project/node_modules/regenerator-runtime/runtime.js:293:22)
[electron]     at Generator.next (~/Project/node_modules/regenerator-runtime/runtime.js:118:21)
[electron]     at Generator.tryCatcher (~/Project/node_modules/bluebird/js/release/util.js:16:23)
[electron]     at PromiseSpawn._promiseFulfilled (~/Project/node_modules/bluebird/js/release/generators.js:97:49)
[electron]     at Promise._settlePromise (~/Project/node_modules/bluebird/js/release/promise.js:609:26)
[electron]     at Promise._settlePromise0 (~/Project/node_modules/bluebird/js/release/promise.js:649:10)
[electron]     at Promise._settlePromises (~/Project/node_modules/bluebird/js/release/promise.js:729:18)
[electron]     at _drainQueueStep (~/Project/node_modules/bluebird/js/release/async.js:93:12)
[electron]     at _drainQueue (~/Project/node_modules/bluebird/js/release/async.js:86:9)
[electron]     at Async._drainQueues (~/Project/node_modules/bluebird/js/release/async.js:102:5)
[electron]     at Immediate.Async.drainQueues [as _onImmediate] (~/Project/node_modules/bluebird/js/release/async.js:15:14)
[electron]     at processImmediate (internal/timers.js:456:21)

Here's my code if it helps, but I just followed the manaul:

return this.sudoer
	.spawn('echo "Hello"')
	.then((cp) => {
		/*
		  cp.output.stdout (Buffer)
		  cp.output.stderr (Buffer)
		*/

		console.log('OUTPUT', cp.output.stdout.toString(), cp.output.stderr.toString());

		return cp.output.stdout.toString();
	})
	.catch(error => console.error('ERROR', error));

@t1gor
Copy link

t1gor commented Nov 11, 2020

Ok, seems like we should have been calling it differently:

sudoer.spawn('echo', ['Hello'])

Please disregard my comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants