toRelativePath function

String toRelativePath(
  1. String absolutePath
)

Convert an absolute path to a relative path from CWD to save tokens.

Implementation

String toRelativePath(String absolutePath) {
  try {
    return p.relative(absolutePath, from: Directory.current.path);
  } catch (_) {
    return absolutePath;
  }
}