(fsUtils: IFsUtils, config: INodeLaunchConfiguration)
| 39 | * existent path within the launch arguments. |
| 40 | */ |
| 41 | const tryGetProgramFromArgs = async (fsUtils: IFsUtils, config: INodeLaunchConfiguration) => { |
| 42 | if (typeof config.stopOnEntry === 'string') { |
| 43 | return resolve(config.cwd, config.stopOnEntry); |
| 44 | } |
| 45 | |
| 46 | if (config.program) { |
| 47 | return resolve(config.cwd, config.program); |
| 48 | } |
| 49 | |
| 50 | for (const arg of asArray(config.args)) { |
| 51 | if (arg.startsWith('-')) { |
| 52 | // looks like a flag |
| 53 | continue; |
| 54 | } |
| 55 | |
| 56 | const candidate = resolve(config.cwd, arg); |
| 57 | if (await fsUtils.exists(candidate)) { |
| 58 | return candidate; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | return undefined; |
| 63 | }; |
| 64 | |
| 65 | @injectable() |
| 66 | export class NodeLauncher extends NodeLauncherBase<INodeLaunchConfiguration> { |
no test coverage detected