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