( filePath: string, env: CliEnv = getCliEnv(), )
| 125 | } |
| 126 | |
| 127 | export const openFileAtPath = async ( |
| 128 | filePath: string, |
| 129 | env: CliEnv = getCliEnv(), |
| 130 | ): Promise<boolean> => { |
| 131 | const commands = buildEditorCommands(filePath, env) |
| 132 | |
| 133 | for (const command of commands) { |
| 134 | // eslint-disable-next-line no-await-in-loop |
| 135 | const success = await runCommand(command) |
| 136 | if (success) { |
| 137 | return true |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | logger.warn( |
| 142 | { filePath, commands }, |
| 143 | 'Failed to open file with any configured editor command', |
| 144 | ) |
| 145 | return false |
| 146 | } |
no test coverage detected