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

fix(scripts): windows: js engine build and run #313

Merged
merged 1 commit into from
Nov 7, 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
2 changes: 1 addition & 1 deletion lua/kulala/globals/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local M = {}

local plugin_tmp_dir = FS.get_plugin_tmp_dir()

M.VERSION = "4.4.0"
M.VERSION = "4.4.1"
M.UI_ID = "kulala://ui"
M.SCRATCHPAD_ID = "kulala://scratchpad"
M.HEADERS_FILE = plugin_tmp_dir .. "/headers.txt"
Expand Down
8 changes: 5 additions & 3 deletions lua/kulala/parser/scripts/engines/javascript/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ local M = {}

local NPM_EXISTS = vim.fn.executable("npm") == 1
local NODE_EXISTS = vim.fn.executable("node") == 1
local NPM_BIN = vim.fn.exepath("npm")
local NODE_BIN = vim.fn.exepath("node")
local SCRIPTS_DIR = FS.get_scripts_dir()
local REQUEST_SCRIPTS_DIR = FS.get_request_scripts_dir()
local SCRIPTS_BUILD_DIR = FS.get_tmp_scripts_build_dir()
Expand All @@ -23,12 +25,12 @@ local FILE_MAPPING = {

M.install = function()
FS.copy_dir(BASE_DIR, SCRIPTS_BUILD_DIR)
local res_install = vim.system({ "npm", "install", "--prefix", SCRIPTS_BUILD_DIR }):wait()
local res_install = vim.system({ NPM_BIN, "install", "--prefix", SCRIPTS_BUILD_DIR }):wait()
if res_install.code ~= 0 then
Logger.error("npm install fail with code " .. res_install.code)
return
end
local res_build = vim.system({ "npm", "run", "build", "--prefix", SCRIPTS_BUILD_DIR }):wait()
local res_build = vim.system({ NPM_BIN, "run", "build", "--prefix", SCRIPTS_BUILD_DIR }):wait()
if res_build.code ~= 0 then
Logger.error("npm run build fail with code " .. res_build.code)
return
Expand Down Expand Up @@ -135,7 +137,7 @@ M.run = function(type, data)
for _, script in ipairs(scripts) do
local output = vim
.system({
"node",
NODE_BIN,
script.path,
}, {
cwd = script.cwd,
Expand Down