diff options
| author | William Boman <william@redwill.se> | 2022-07-10 16:32:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-10 16:32:19 +0200 |
| commit | d1a88ff9cf52feee7ed6893070533955fa022204 (patch) | |
| tree | 4b6a061e27609f4a0670b27865281e2c60814d5d /lua/mason-registry/node-debug2-adapter/init.lua | |
| parent | feat: add luacheck to the registry (#46) (diff) | |
| download | mason-d1a88ff9cf52feee7ed6893070533955fa022204.tar mason-d1a88ff9cf52feee7ed6893070533955fa022204.tar.gz mason-d1a88ff9cf52feee7ed6893070533955fa022204.tar.bz2 mason-d1a88ff9cf52feee7ed6893070533955fa022204.tar.lz mason-d1a88ff9cf52feee7ed6893070533955fa022204.tar.xz mason-d1a88ff9cf52feee7ed6893070533955fa022204.tar.zst mason-d1a88ff9cf52feee7ed6893070533955fa022204.zip | |
fix(node-debug2-adapter): fix build on Node >= 18 (#47)
Fixes #41.
Diffstat (limited to 'lua/mason-registry/node-debug2-adapter/init.lua')
| -rw-r--r-- | lua/mason-registry/node-debug2-adapter/init.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lua/mason-registry/node-debug2-adapter/init.lua b/lua/mason-registry/node-debug2-adapter/init.lua index 76b24a6d..33ff2790 100644 --- a/lua/mason-registry/node-debug2-adapter/init.lua +++ b/lua/mason-registry/node-debug2-adapter/init.lua @@ -4,6 +4,7 @@ local git = require "mason-core.managers.git" local _ = require "mason-core.functional" local path = require "mason-core.path" local Optional = require "mason-core.optional" +local platform = require "mason-core.platform" return Pkg.new { name = "node-debug2-adapter", @@ -18,7 +19,19 @@ return Pkg.new { source.with_receipt() git.clone { "https://github.com/microsoft/vscode-node-debug2", version = Optional.of(source.tag) } ctx.spawn.npm { "install" } - ctx.spawn.npm { "run", "build" } + local node_env = platform + .get_node_version() + :map(function(version) + if version[1] >= 18 then + return { + NODE_OPTIONS = "--no-experimental-fetch", + } + else + return {} + end + end) + :get_or_else {} + ctx.spawn.npm { "run", "build", env = node_env } ctx.spawn.npm { "install", "--production" } ctx:link_bin( "node-debug2-adapter", |
