deleteSymlink function

void deleteSymlink(
  1. String linkPath
)

Deletes the symlink at linkPath

On Windows you need to be in developer mode or running as an Administrator to delete a symlink.

To enable developer mode see: https://dcli.onepub.dev/getting-started/installing-on-windows

To check if your script is running as an administrator use:

Shell.current.isPrivileged

Implementation

void deleteSymlink(String linkPath) {
  verbose(() => 'deleteSymlink linkPath: $linkPath');
  Link(linkPath).deleteSync();
}