Improved helper scripts
This commit is contained in:
		| @@ -1,3 +1,3 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| dart run src/day$1.dart $1 | ||||
| dart run src/day$1.dart $2 $1 | ||||
| @@ -2,8 +2,7 @@ import 'dart:io'; | ||||
| import 'package:http/http.dart' as http; | ||||
|  | ||||
| Map<String, String> getCookieHeaders() { | ||||
|   print(Directory.current.path); | ||||
|   var env = File('../.env'); | ||||
|   var env = File('.env'); | ||||
|   if (!env.existsSync()) { | ||||
|     throw Exception('Session key from https://adventofcode.com/ required'); | ||||
|   } | ||||
|   | ||||
| @@ -8,6 +8,9 @@ void secondPart() {} | ||||
|  | ||||
| Future<void> main(List<String> args) async { | ||||
|   if (args.isEmpty) { | ||||
|     print("Expected year"); | ||||
|     return; | ||||
|   } else if (args.length < 2) { | ||||
|     print("Expected day"); | ||||
|     return; | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user