| ... |
... |
@@ -324,6 +324,7 @@ def main() -> None: |
|
324
|
324
|
# TODO: We could work out the --version from the project-version CI job.
|
|
325
|
325
|
parser.add_argument('--version', required=True, type=str, help='Version of the GHC compiler')
|
|
326
|
326
|
parser.add_argument('--date', required=True, type=str, help='Date of the compiler release')
|
|
|
327
|
+ parser.add_argument('output_path', nargs='?', type=Path, help='Path to write the output to, if not set, dump to stdout')
|
|
327
|
328
|
args = parser.parse_args()
|
|
328
|
329
|
|
|
329
|
330
|
project = gl.projects.get(1, lazy=True)
|
| ... |
... |
@@ -352,13 +353,14 @@ def main() -> None: |
|
352
|
353
|
with open(args.metadata, 'r') as file:
|
|
353
|
354
|
ghcup_metadata = yaml.safe_load(file)
|
|
354
|
355
|
if args.version in ghcup_metadata['ghcupDownloads']['GHC']:
|
|
355
|
|
- # if there are days without a commit, then the nightly metadata
|
|
356
|
|
- # is up to date by default, no need to fail, no need to upload anything
|
|
357
|
|
- print("Refusing to override existing version in metadata, exiting")
|
|
358
|
|
- sys.exit()
|
|
|
356
|
+ eprint("GHCUp nightly run produced the same metadata as last night")
|
|
359
|
357
|
setNightlyTags(ghcup_metadata)
|
|
360
|
358
|
ghcup_metadata['ghcupDownloads']['GHC'][args.version] = new_yaml
|
|
361
|
|
- print(yaml.dump(ghcup_metadata))
|
|
|
359
|
+ if args.output_path:
|
|
|
360
|
+ with open(args.output_path, 'w') as ofile:
|
|
|
361
|
+ yaml.dump(ghcup_metadata, ofile)
|
|
|
362
|
+ else:
|
|
|
363
|
+ print(yaml.dump(ghcup_metadata))
|
|
362
|
364
|
|
|
363
|
365
|
|
|
364
|
366
|
|