appendToPATH method

void appendToPATH(
  1. String newPath
)

Appends 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 appendToPATH(String newPath) {
  final path = PATH..add(newPath);
  _setEnv('PATH', path.join(delimiterForPATH));
}