getFinalDir static method
Returns the result of path.normalize
, as an absolute path from Directory.current.
Implementation
static String getFinalDir(String dirPath) {
var finalPath = dirPath;
if (!path.isAbsolute(finalPath)) finalPath = path.absolute(finalPath);
if (finalPath.endsWith('/.')) {
finalPath = finalPath.substring(0, finalPath.length - 2);
}
return path.normalize(finalPath);
}