Skip to content

Commit

Permalink
fix(node): handle non-file argument passes correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
wintercounter committed Feb 4, 2022
1 parent a09020a commit d043819
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/processes/ecosystem/root/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ import path from 'path'
import Process from '@/processes'

const getCmdNodeCLI = ({ mhyArgv: { _ }, flags }) => {
const script = _[1] || 'src'
return ['node', path.resolve(__dirname, '../../../resources/nodeProcessSetup'), '--mhy-script', script, ...flags]
const [, ...args] = _
const script = args.pop() || 'src'
return [
'node',
...args,
path.resolve(__dirname, '../../../resources/nodeProcessSetup'),
'--mhy-script',
script,
...flags
]
}

class Node extends Process {
Expand Down

0 comments on commit d043819

Please sign in to comment.