toRemove method

Future<String> toRemove()

Generates a script to remove the package.

The script is generated based on the current operating system and package manager.

Implementation

Future<String> toRemove() async {
  await boot();

  final bestFor = await best(to: 'remove');

  final dynamicCode = await this.dynamicCode();

  final baseScriptContents = await this.baseScriptContents();

  final packageScriptContents = await packageScript.contents();

  String togetherContents =
      '''
#!/usr/bin/env bash

$dynamicCode

$baseScriptContents

$packageScriptContents

${Global.updateCommand}

$bestFor
''';

  return (await writeThisBeast(togetherContents)).path;
}