removeFromPATH method

void removeFromPATH(
  1. String oldPath
)

Removes the given oldPath from the PATH environment variable.

Changing the PATH has no affect on the parent process (shell) that launched this script.

Changing the path affects the current script and any children that it spawns.

See: appendToPATH prependToPATH

Implementation

void removeFromPATH(String oldPath) {
  final path = PATH..remove(oldPath);
  _setEnv('PATH', path.join(delimiterForPATH));
}