mirror of
https://github.com/RGBCube/AdventOfCode
synced 2025-07-25 19:17:44 +00:00
Add run script
This commit is contained in:
parent
dfda2c002c
commit
5832784e82
2 changed files with 18 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -8,3 +8,4 @@
|
|||
!*.in
|
||||
!*.md
|
||||
!*.nix
|
||||
!*.nu
|
||||
|
|
17
run.nu
Executable file
17
run.nu
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env nu
|
||||
|
||||
# Run a specified AoC challenge.
|
||||
def main [
|
||||
year_day_part_ext: string # The file to run. For example `2023/1-2.py` or `2023/1-2.nix`.
|
||||
] {
|
||||
match ($year_day_part_ext | path parse | get extension) {
|
||||
"nix" => {
|
||||
nix eval (".#" + ($year_day_part_ext | str replace ".nix" ""))
|
||||
}
|
||||
"py" => {
|
||||
cd ($year_day_part_ext | path dirname)
|
||||
python $year_day_part_ext
|
||||
cd -
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue