prependToPATH method

void prependToPATH(
  1. String newPath
)

Prepends newPath to the list of paths in 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.

Implementation

void prependToPATH(String newPath) {
  final path = PATH..insert(0, newPath);
  _setEnv('PATH', path.join(delimiterForPATH));
}