Skip to content

Running sudo app #1200

Closed Answered by ElTacitos
ElTacitos asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks to @johnlindquist for the answer:

let password = await arg({
    placeholder: "Enter sudo password",
    secret: true
})

const resp = await exec(`echo ${password} | sudo -S pmset -g`)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ElTacitos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant