Skip to content

Commit c445af4

Browse files
committed
Rename cmd/ -> solution/
1 parent ee50e41 commit c445af4

File tree

11 files changed

+30
-30
lines changed

11 files changed

+30
-30
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ Solving the 2020 edition of https://adventofcode.com/ in many languages, and tes
33

44
## Contributing
55
1. Make a branch. Example: `git checkout -b jonas/day-03`
6-
2. Write a program, in the language of your choice. Example: `vim day-03/cmd/super-optimized.py`
6+
2. Write a program, in the language of your choice. Example: `vim day-03/solution/super-optimized.py`
77
3. Test your program.
88

99
```sh
10-
cat day-03/input | python3 day-03/cmd/super-optimized.py | diff - day-03/output
10+
cat day-03/input | python3 day-03/solution/super-optimized.py | diff - day-03/output
1111
```
1212

1313
4. Make sure your program is automatically tested by the Github CI, by adding a line of code to `day-03/test.sh`.
1414
*Example line:*
1515
```sh
16-
$DIR/../scripts/test-py.sh $DIR "cmd/super-optimized.py"
16+
$DIR/../scripts/test-py.sh $DIR "solution/super-optimized.py"
1717
```
1818

1919
5. Make a Pull Request to the `main` branch.

day-00-example/test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
DIR=$(dirname $(realpath $0))
33

44
# Run tests
5-
$DIR/../scripts/test-deno.sh $DIR "cmd/main.deno.ts"
6-
$DIR/../scripts/test-go.sh $DIR "cmd/main.go"
7-
$DIR/../scripts/test-node.sh $DIR "cmd/main.node.mjs"
8-
$DIR/../scripts/test-py.sh $DIR "cmd/main.py"
5+
$DIR/../scripts/test-deno.sh $DIR "solution/main.deno.ts"
6+
$DIR/../scripts/test-go.sh $DIR "solution/main.go"
7+
$DIR/../scripts/test-node.sh $DIR "solution/main.node.mjs"
8+
$DIR/../scripts/test-py.sh $DIR "solution/main.py"

scripts/make-folders.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Make folders for all the days in the calendar
44
for i in {01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25}
55
do
6-
mkdir -p "./day-$i/cmd"
7-
cat > "./day-$i/cmd/.keep" << KEEP
6+
mkdir -p "./day-$i/solution"
7+
cat > "./day-$i/solution/.keep" << KEEP
88
KEEP
99

1010
cat > "./day-$i/README.md" << README
@@ -27,7 +27,7 @@ set -e
2727
DIR=$(dirname $(realpath $0))
2828
2929
# Run tests
30-
# Example: $DIR/../scripts/test-deno.sh $DIR ./cmd/main.deno.ts
30+
# Example: $DIR/../scripts/test-deno.sh $DIR ./solution/main.deno.ts
3131
TEST
3232

3333
chmod +x ./day-$i/test.sh

scripts/test-deno.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
set -e
33

4-
# Usage: ../test-deno.sh DIR CMD
5-
# Example: ../test-deno.sh /adventofcode2020/day-03 cmd/main.deno.ts
4+
# Usage: ../test-deno.sh DIR SOLUTION
5+
# Example: ../test-deno.sh /adventofcode2020/day-03 solution/main.deno.ts
66

77
DIR="$1"
8-
CMD="$2"
8+
SOLUTION="$2"
99

10-
cat "$DIR/input" | deno run "$DIR/$CMD" | diff - "$DIR/output"
11-
echo "$DIR / deno run $CMD"
10+
cat "$DIR/input" | deno run "$DIR/$SOLUTION" | diff - "$DIR/output"
11+
echo "$DIR / deno run $SOLUTION"

scripts/test-go.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
set -e
33

4-
# Usage: ../test-go.sh DIR CMD
5-
# Example: ../test-go.sh /adventofcode2020/day-03 cmd/main.go
4+
# Usage: ../test-go.sh DIR SOLUTION
5+
# Example: ../test-go.sh /adventofcode2020/day-03 solution/main.go
66

77
DIR="$1"
8-
CMD="$2"
8+
SOLUTION="$2"
99

10-
cat "$DIR/input" | go run "$DIR/$CMD" | diff - "$DIR/output"
11-
echo "$DIR / go run $CMD"
10+
cat "$DIR/input" | go run "$DIR/$SOLUTION" | diff - "$DIR/output"
11+
echo "$DIR / go run $SOLUTION"

scripts/test-node.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
22
set -e
33

4-
# Usage: ../test-node.sh DIR CMD
5-
# Example: ../test-node.sh /adventofcode2020/day-03 cmd/main.node.mjs
4+
# Usage: ../test-node.sh DIR SOLUTION
5+
# Example: ../test-node.sh /adventofcode2020/day-03 solution/main.node.mjs
66

77
DIR="$1"
8-
CMD="$2"
8+
SOLUTION="$2"
99

10-
cat "$DIR/input" | node "$DIR/$CMD" | diff - "$DIR/output"
11-
echo "$DIR / node $CMD"
10+
cat "$DIR/input" | node "$DIR/$SOLUTION" | diff - "$DIR/output"
11+
echo "$DIR / node $SOLUTION"

0 commit comments

Comments
 (0)