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