addExecutableAsset function
Implementation
void addExecutableAsset(SimpleGitHub ghr, ghub.Release release, String script) {
String? mimeType;
String assetPath = join(dirname(script), basenameWithoutExtension(script));
if (Platform.isWindows) {
assetPath =
'${join(dirname(script), basenameWithoutExtension(script))}.exe';
mimeType = lookupMimeType(assetPath);
} else {
assetPath = join(dirname(script), basenameWithoutExtension(script));
/// fake the .exe extension for the mime lookup.
mimeType = lookupMimeType('$assetPath.exe');
}
/// use dcli to compile.
Script.fromFile(script).compile(overwrite: true);
addAsset(ghr, release, assetPath: assetPath, mimeType: mimeType);
}