sntran/rclone.js

Add ability to pass options to child process spawned (e.g. env vars)

Closed this issue · 4 comments

Hi there,

This was addressed in c6c57e1. Can you give it a try?

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.

https://rclone.org/docs/#environment-variables

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.

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.