22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ // ignore_for_file: lines_longer_than_80_chars
6+
57import 'dart:io' ;
68
79import 'package:args/args.dart' ;
@@ -148,7 +150,7 @@ class Trebuchet {
148150 '--allow-unrelated-histories' ,
149151 '${input }_package/$branchName ' ,
150152 '-m' ,
151- 'Merge package:$input into shared tool repository'
153+ 'Merge package:$input into shared $ target repository'
152154 ],
153155 );
154156
@@ -162,19 +164,24 @@ class Trebuchet {
162164 );
163165 }
164166
167+ final remainingSteps = [
168+ 'Move and fix workflow files' ,
169+ if (! shouldPush)
170+ 'Run `git push --set-upstream origin merge-$input -package` in the monorepo directory' ,
171+ 'Disable squash-only in GitHub settings, and merge with a fast forward merge to the main branch, enable squash-only in GitHub settings.' ,
172+ "Push tags to github using `git tag --list '$input *' | xargs git push origin`" ,
173+ 'Follow up with a PR adding links to the top-level readme table.' ,
174+ 'Transfer issues by running `dart run pkgs/repo_manage/bin/report.dart transfer-issues --source-repo dart-lang/$input --target-repo dart-lang/$target --add-label package:$input --apply-changes`' ,
175+ "Add a commit to https://github.com/dart-lang/$input / with it's readme pointing to the monorepo." ,
176+ 'Update the auto-publishing settings on pub.dev/packages/$input .' ,
177+ 'Archive https://github.com/dart-lang/$input /.' ,
178+ ];
179+
165180 print ('DONE!' );
166181 print ('''
167182Steps left to do:
168183
169- - Move and fix workflow files
170- ${shouldPush ? '' : '- Run `git push --set-upstream origin merge-$input -package` in the monorepo directory' }
171- - Disable squash-only in GitHub settings, and merge with a fast forward merge to the main branch, enable squash-only in GitHub settings.
172- - Push tags to github using `git tag --list '$input *' | xargs git push origin`
173- - Follow up with a PR adding links to the top-level readme table.
174- - Transfer issues by running `dart run pkgs/repo_manage/bin/report.dart transfer-issues --source-repo dart-lang/$input --target-repo dart-lang/$target --add-label package:$input --apply-changes`
175- - Add a commit to https://github.com/dart-lang/$input / with it's readme pointing to the monorepo.
176- - Update the auto-publishing settings on pub.dev/packages/$input .
177- - Archive https://github.com/dart-lang/$input /.
184+ ${remainingSteps .map ((step ) => ' - $step ' ).join ('\n ' )}
178185''' );
179186 }
180187
@@ -191,27 +198,30 @@ ${shouldPush ? '' : '- Run `git push --set-upstream origin merge-$input-package`
191198 bool overrideDryRun = false ,
192199 }) async {
193200 final workingDirectory = inTarget ? targetPath : inputPath;
194- print ('----------' );
195- print ('Running `$executable $arguments ` in $workingDirectory ' );
201+ print ('' );
202+ print ('${bold ('$executable ${arguments .join (' ' )}' )} '
203+ '${subtle ('[$workingDirectory ]' )}' );
196204 if (! dryRun || overrideDryRun) {
197205 final processResult = await Process .run (
198206 executable,
199207 arguments,
200208 workingDirectory: workingDirectory,
201209 );
202- print ('stdout:' );
203- print (processResult.stdout);
204- if ((processResult.stderr as String ).isNotEmpty) {
205- print ('stderr:' );
206- print (processResult.stderr);
210+ final out = processResult.stdout as String ;
211+ if (out.isNotEmpty) {
212+ print (indent (out).trimRight ());
213+ }
214+ final err = processResult.stderr as String ;
215+ if (err.isNotEmpty) {
216+ print (indent (err).trimRight ());
207217 }
208218 if (processResult.exitCode != 0 ) {
209219 throw ProcessException (executable, arguments);
210220 }
211221 } else {
212- print ('Not running, as --dry-run is set. ' );
222+ print (' (not running; --dry-run is set) ' );
213223 }
214- print ('========== ' );
224+ print ('' );
215225 }
216226
217227 Future <void > filterRepo (List <String > args) async {
@@ -228,3 +238,10 @@ Future<void> inTempDir(Future<void> Function(Directory temp) f) async {
228238 await f (tempDirectory);
229239 await tempDirectory.delete (recursive: true );
230240}
241+
242+ String bold (String str) => '\u 001b[1m$str \u 001b[22m' ;
243+
244+ String subtle (String str) => '\u 001b[2m$str \u 001b[22m' ;
245+
246+ String indent (String str) =>
247+ str.split ('\n ' ).map ((line) => ' $line ' ).join ('\n ' );
0 commit comments