(result: AddDirectoryResult)
| 93 | } |
| 94 | |
| 95 | export function addDirHelpMessage(result: AddDirectoryResult): string { |
| 96 | switch (result.resultType) { |
| 97 | case 'emptyPath': |
| 98 | return 'Please provide a directory path.' |
| 99 | case 'pathNotFound': |
| 100 | return `Path ${chalk.bold(result.absolutePath)} was not found.` |
| 101 | case 'notADirectory': { |
| 102 | const parentDir = dirname(result.absolutePath) |
| 103 | return `${chalk.bold(result.directoryPath)} is not a directory. Did you mean to add the parent directory ${chalk.bold(parentDir)}?` |
| 104 | } |
| 105 | case 'alreadyInWorkingDirectory': |
| 106 | return `${chalk.bold(result.directoryPath)} is already accessible within the existing working directory ${chalk.bold(result.workingDir)}.` |
| 107 | case 'success': |
| 108 | return `Added ${chalk.bold(result.absolutePath)} as a working directory.` |
| 109 | } |
| 110 | } |
| 111 | |
| 112 |
no outgoing calls
no test coverage detected