deleteSymlink function

Future<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

Future<void> deleteSymlink(String linkPath) async {
  verbose(() => 'deleteSymlink linkPath: $linkPath');
  await Link(linkPath).delete();
}