Add ability to pass options to child process spawned (e.g. env vars)
Closed this issue · 4 comments
niftylettuce commented
niftylettuce commented
Ah this is clever, could this be added to the docs perhaps? Maybe an example with env
, since rclone allows you to pass env vars in the command.
sntran commented
Technically, env
option defaults to process.env
, so you can already use rclone's environment variables directly in the shell.
For example:
RCLONE_CONFIG=~/.config/rclone/rclone.conf npx rclone ls source:
I can't remember if I did test that or not :) If you can give it a try, let me know what you find.
I'll find some time to try that and update the docs.
niftylettuce commented
I wanted to do this in a sandboxed way, that way only the child process would have the env vars, so that's why I wanted to see if spawn support was there for it - which it is.