({ workingDir, file }: { workingDir?: string; file: string })
| 107 | const localAppDir = getAppDataDir(getDefaultProductName()); |
| 108 | |
| 109 | export const getAbsoluteFilePath = ({ workingDir, file }: { workingDir?: string; file: string }) => { |
| 110 | if (!file) { |
| 111 | return ''; |
| 112 | } |
| 113 | |
| 114 | if (workingDir) { |
| 115 | if (fs.existsSync(workingDir) && !fs.statSync(workingDir).isDirectory()) { |
| 116 | return nodePath.resolve(nodePath.dirname(workingDir), file); |
| 117 | } |
| 118 | return nodePath.resolve(workingDir, file); |
| 119 | } |
| 120 | |
| 121 | return nodePath.resolve(process.cwd(), file); |
| 122 | }; |
| 123 | export const logErrorAndExit = (err?: Error) => { |
| 124 | if (err instanceof InsoError) { |
| 125 | logger.fatal(err.message); |
no test coverage detected