Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed node_modules path on non-windows #31

Merged
merged 9 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion R/node.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ install_flowr <- function(flowr_ver, verbose = FALSE, base_dir = get_default_nod
#' @export
exec_flowr <- function(args, verbose = FALSE, base_dir = get_default_node_base_dir(), background = FALSE) {
# we installed flowr globally (see above) in the scope of our local node installation, so we can find it here
flowr_path <- file.path(get_node_exe_dir(base_dir), "node_modules", "@eagleoutice", "flowr", "cli", "flowr.js")
node_modules <- if (get_os() == "win") "node_modules" else file.path("lib", "node_modules")
flowr_path <- file.path(get_node_exe_dir(base_dir), node_modules, "@eagleoutice", "flowr", "cli", "flowr.js")
exec_node_command("node", c(flowr_path, args), verbose, base_dir, background)
}

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-node.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ test_that("find package directory", {
})
test_that("install node", {
options(timeout = 300)
expect_no_error(install_node("22.5.1"))
expect_no_error(install_node("22.9.0", TRUE))
})
test_that("install flowr", {
expect_equal(install_flowr("2.0.11"), 0)
expect_equal(install_flowr("2.0.11", TRUE), 0)
})