I am writing an R package (for internal use, will never be on CRAN). One of my functions calls a shell script containing node.js
commands. I've put the file in inst/node_script.sh
, so that when the package is installed I can call the script with
system(system.file("./node_script.sh", package = "mypackage"))
This works great on my development machine. But when I install the package on a test machine, node_script.sh
is in the proper place, but it drops the executable mode, so I can't run the script without first chmod +x ...
. Three questions:
devtools::install_github
I got this working (kind of) by including a 'chmod' command immediately before the call.
node_file <- system.file("./node_script.sh", package = "mypackage")
Sys.chmod(node_file, mode = "0555")
system(node_file)
It seems very hacky to me, and I'd love an alternative.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With