isGloballyInstalled static method
Check if SmartPub is globally installed
Implementation
static Future<bool> isGloballyInstalled() async {
try {
final result = await Process.run(
'dart',
<String>['pub', 'global', 'list'],
runInShell: true,
);
if (result.exitCode == 0) {
final output = result.stdout.toString();
return output.contains('smartpub ');
}
return false;
} catch (e) {
return false;
}
}