diff options
author | mhsn <mail@mhsn.net> | 2025-03-19 23:00:33 +0000 |
---|---|---|
committer | mhsn <mail@mhsn.net> | 2025-03-19 23:00:33 +0000 |
commit | f816dc060d6af9e242c64f668d0b865dba54137d (patch) | |
tree | 0e3afadbd27954037fe86d927e82ba7e192fe57e | |
parent | b4706ddd0a8f441db947bd689a98d03e7dcb2919 (diff) | |
download | aoc-f816dc060d6af9e242c64f668d0b865dba54137d.tar.gz aoc-f816dc060d6af9e242c64f668d0b865dba54137d.zip |
POSIXify check
-rwxr-xr-x | check | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ -#!/usr/bin/env yash +#!/usr/bin/env sh year=$1 day=$2 @@ -12,14 +12,14 @@ script_path=$(dirname "$script") aoc_path=$script_path/$1/$2 data_path="$aoc_path/data/$4.txt" -if [[ $lang == "python" ]]; then +if [ $lang = "python" ]; then got=$(cat $data_path | python $aoc_path/python/main.py) -elif [[ $lang == "rust" ]]; then - got=$(cat $data_path | cargo run --manifest-path $aoc_path/rust/Cargo.toml -- <(cat $data_path)) +elif [ $lang = "rust" ]; then + got=$(cat $data_path | cargo run --manifest-path $aoc_path/rust/Cargo.toml --) else echo "Unknown lang: $lang" exit 1 fi -diff $aoc_path/data/$4.ans - <(echo "$got") && echo Solved wtih $lang! +echo "$got" | diff $aoc_path/data/$4.ans - && echo Solved wtih $lang! echo $got |