Skip to content

custom runtime option for runCommand #37

Description

@thescientist13

Summary

Currently runCommand assumes node by default.

const runner = isWindows ? 'node.cmd' : 'node';

Would be nice if you could invoke other runtimes instead, like deno or bun.

Details

For example

runCommand(binPath, args = '', options = {}) {
  return new Promise(async (resolve, reject) => {
    const cliPath = binPath;
    const finalArgs = this.forwardParentArgs ? process.execArgv : [];
    const runtime = options.runtime ? options.runtime : 'node';
    let err = '';
    
    const runner = isWindows ? `${runtime}.cmd' : runtime;
  })
})

Not sure if we can just assume a suffix of .cmd for Windows?


Originally the thought was that something that other than node could be run, like yarn or npm, but that would be too much of an awkward API change, plus it's just as easy to do one off commands in userland as needed.

Details For example, this can be nice where additional setup work might be needed using a different executable, like running a `yarn install` or `npm ci`
  runCommand(binPath, args = '', executable = 'node') {
    return new Promise(async (resolve, reject) => {
      const cliPath = binPath;
      const finalArgs = this.forwardParentArgs ? process.execArgv : [];
      let err = '';
  const runner = isWindows ? `${executable}.cmd' : 'node';
})

})

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationfeature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions