* Resolve to an absolute path * * Accepts * - FileName * - FileName.ext * - /path/to/FileName * - /path/to/FileName.ext * * - Add the extension if not already added * - Resolve to `/path/to/FileName.ext` * * @param {String} filePath an absolute or a relative path * @param {St
(filePath, extension)
| 170 | * @return {String} |
| 171 | */ |
| 172 | function resolveFilePath(filePath, extension) { |
| 173 | |
| 174 | var resolvedPath = di.path.resolve(filePath); |
| 175 | |
| 176 | // The extension is not added |
| 177 | if (di.path.extname(resolvedPath) != '.' + extension) { |
| 178 | resolvedPath += '.' + extension; |
| 179 | } |
| 180 | |
| 181 | return resolvedPath; |
| 182 | |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Get the default configurations |