Skip to content

Commit

Permalink
Merge pull request #12 from codecrafters-io/fix-missing-dot-cc-files
Browse files Browse the repository at this point in the history
Add CodeCrafters build and run scripts for Python and Rust starters
  • Loading branch information
rohitpaulk committed Jul 5, 2024
2 parents 686b6ee + a77e56b commit 3d8b223
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 0 deletions.
9 changes: 9 additions & 0 deletions compiled_starters/python/.codecrafters/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
#
# This script is used to compile your program on CodeCrafters
#
# This runs before .codecrafters/run.sh
#
# Learn more: https://codecrafters.io/program-interface

# (This file is empty since Python programs don't use a compile step)
9 changes: 9 additions & 0 deletions compiled_starters/python/.codecrafters/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
#
# This script is used to run your program on CodeCrafters
#
# This runs after .codecrafters/compile.sh
#
# Learn more: https://codecrafters.io/program-interface

exec pipenv run python3 -m app.main "$@"
16 changes: 16 additions & 0 deletions compiled_starters/rust/.codecrafters/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
#
# This script is used to compile your program on CodeCrafters
#
# This runs before .codecrafters/run.sh
#
# Learn more: https://codecrafters.io/program-interface

# Exit early if any commands fail
set -e

cargo build \
--quiet \
--release \
--target-dir=/tmp/codecrafters-interpreter-target \
--manifest-path Cargo.toml
9 changes: 9 additions & 0 deletions compiled_starters/rust/.codecrafters/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
#
# This script is used to run your program on CodeCrafters
#
# This runs after .codecrafters/compile.sh
#
# Learn more: https://codecrafters.io/program-interface

exec /tmp/codecrafters-interpreter-target/release/interpreter-starter-rust "$@"
9 changes: 9 additions & 0 deletions solutions/python/01-ry8/code/.codecrafters/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
#
# This script is used to compile your program on CodeCrafters
#
# This runs before .codecrafters/run.sh
#
# Learn more: https://codecrafters.io/program-interface

# (This file is empty since Python programs don't use a compile step)
9 changes: 9 additions & 0 deletions solutions/python/01-ry8/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
#
# This script is used to run your program on CodeCrafters
#
# This runs after .codecrafters/compile.sh
#
# Learn more: https://codecrafters.io/program-interface

exec pipenv run python3 -m app.main "$@"
16 changes: 16 additions & 0 deletions solutions/rust/01-ry8/code/.codecrafters/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
#
# This script is used to compile your program on CodeCrafters
#
# This runs before .codecrafters/run.sh
#
# Learn more: https://codecrafters.io/program-interface

# Exit early if any commands fail
set -e

cargo build \
--quiet \
--release \
--target-dir=/tmp/codecrafters-interpreter-target \
--manifest-path Cargo.toml
9 changes: 9 additions & 0 deletions solutions/rust/01-ry8/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
#
# This script is used to run your program on CodeCrafters
#
# This runs after .codecrafters/compile.sh
#
# Learn more: https://codecrafters.io/program-interface

exec /tmp/codecrafters-interpreter-target/release/interpreter-starter-rust "$@"
8 changes: 8 additions & 0 deletions starter-repository-definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
target: README.md
- source: starter_templates/codecrafters.yml
target: codecrafters.yml
- source: starter_templates/python/.codecrafters/compile.sh
target: .codecrafters/compile.sh
- source: starter_templates/python/.codecrafters/run.sh
target: .codecrafters/run.sh
- source: starter_templates/python/app/main.py
target: app/main.py
- source: starter_templates/python/Pipfile
Expand All @@ -26,6 +30,10 @@
target: README.md
- source: starter_templates/codecrafters.yml
target: codecrafters.yml
- source: starter_templates/rust/.codecrafters/compile.sh
target: .codecrafters/compile.sh
- source: starter_templates/rust/.codecrafters/run.sh
target: .codecrafters/run.sh
- source: starter_templates/rust/src/main.rs
target: src/main.rs
- source: starter_templates/rust/.gitignore
Expand Down

0 comments on commit 3d8b223

Please sign in to comment.