Add 'execute' method

This commit is contained in:
KaKi87 2021-11-19 16:43:12 +01:00
parent 5d246a82a4
commit 3b5ec4bdfe
2 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,10 @@ import childProcess from 'child_process';
import signalCliWrapper from 'signal-cli-wrapper';
export default ({ signalCliPath }) => signalCliWrapper({
execute: args => new Promise(resolve => childProcess.exec(
[signalCliPath, ...args].join(' '),
(_, stdout, stderr) => resolve([stdout.trim(), stderr.trim()].join('\n').trim())
)),
spawn: ({
args,
onData

View File

@ -4,4 +4,4 @@
"signal-cli-wrapper@git+https://git.kaki87.net/KaKi87/signal-cli-wrapper.git":
version "0.1.0"
resolved "git+https://git.kaki87.net/KaKi87/signal-cli-wrapper.git#2f915f72e1c9855d358f7303edaefd44ce012622"
resolved "git+https://git.kaki87.net/KaKi87/signal-cli-wrapper.git#c4555736f0314540a4f01011db34ae5c2f9e247e"