commit 36039074a3be9180d634a94d84b3194a517c47e2 Author: Boming Zhang Date: Sat Jun 29 16:03:24 2024 -0400 feat: init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..497fc64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +joj3_result.json diff --git a/conf.toml b/conf.toml new file mode 100644 index 0000000..6a069b9 --- /dev/null +++ b/conf.toml @@ -0,0 +1,31 @@ +skipGitea = true +[[stages]] +name = "keyword" +[stages.executor] +name = "sandbox" +[stages.executor.with.default] +args = ["bash", "-c", ". ./src/lib.sh; check_files ./src/assets"] +env = ["PATH=/usr/bin:/bin:/usr/local/bin"] +cpuLimit = 10_000_000_000 +memoryLimit = 104_857_600 +procLimit = 50 +copyInCwd = true +copyOut = ["stdout", "stderr"] +[stages.executor.with.default.stdin] +content = "" +[stages.executor.with.default.stdout] +name = "stdout" +max = 65_536 +[stages.executor.with.default.stderr] +name = "stderr" +max = 65_536 +[stages.parser] +name = "keyword" +[stages.parser.with] +fullScore = 100 +minScore = 0 +files = ["stdout"] +endOnMatch = true +[[stages.parser.with.matches]] +keyword = "check files error" +score = 5 diff --git a/src/assets/0.txt b/src/assets/0.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/assets/1.txt b/src/assets/1.txt new file mode 100644 index 0000000..e69de29 diff --git a/src/lib.sh b/src/lib.sh new file mode 100644 index 0000000..6e02d0f --- /dev/null +++ b/src/lib.sh @@ -0,0 +1,7 @@ +# count file number in a given directory +function check_files() { + file_count=$(find $1 -type f | wc -l) + if [ $file_count -ge 1 ]; then + echo "check files error: more than 1 file found in $1!" + fi +}