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

npm and other commands from Windows #37

Open
andreivinca opened this issue Feb 13, 2024 · 0 comments
Open

npm and other commands from Windows #37

andreivinca opened this issue Feb 13, 2024 · 0 comments

Comments

@andreivinca
Copy link

Executing npm modules as separate processes on Windows requires including their file extensions. For example, "eslint" should be "eslint.cmd".

The solution would look like this:

function lint.command(cmd)

   vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  if PLATFORM == "Windows" then
    table.insert(cmd, 1, "/C")
    table.insert(cmd, 1, "cmd.exe")
  end
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  return function (filename)
    return map(cmd, function (k, v)
      if type(k) == "number" and v == lint.filename then
        return filename
      end
      return v
    end)
  end
end

However, I believe encapsulating all Windows commands after "cmd.exe /C" without offering an option within the linter script to bypass this encapsulation isn't the most effective approach. Additionally, there's currently no way to send something like 'windows_skip_cmd' flag to customize the command's construction, without breaking changes.

@andreivinca andreivinca changed the title npm and other command from Windows npm and other commands from Windows Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant