publish method
Implementation
bool publish(String pubspecPath,
{required bool autoAnswer, required bool dryrun}) {
final projectRoot = dirname(pubspecPath);
final version = Version.parse(Platform.version.split(' ')[0]);
var cmd = 'dart pub publish';
if (version.major == 2 && version.minor < 9) {
cmd = 'pub publish';
}
if (dryrun) {
cmd += ' --dry-run';
}
if (autoAnswer && !dryrun) {
cmd += ' --force';
}
// if (!waitForEx(cli.check(cmd, workingDirectory: projectRoot))) {
// throw PubReleaseException('The publish attempt failed.');
// }
final progress = cmd.start(
terminal: true,
workingDirectory: projectRoot,
progress: Progress.print(),
nothrow: true);
return progress.exitCode == 0;
}