Skip to content

Commit

Permalink
Merge pull request #90 from codecrafters-io/update-gleam
Browse files Browse the repository at this point in the history
update gleam
  • Loading branch information
rohitpaulk authored Aug 6, 2024
2 parents 99ca937 + 6064767 commit f655f81
Show file tree
Hide file tree
Showing 19 changed files with 44 additions and 48 deletions.
2 changes: 1 addition & 1 deletion compiled_starters/gleam/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec gleam run -- "$@"
exec gleam run --module main -- "$@"
6 changes: 3 additions & 3 deletions compiled_starters/gleam/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ expressions are evaluated.

# Passing the first stage

The entry point for your `grep` implementation is in `src/grep.gleam`. Study and
The entry point for your `grep` implementation is in `src/main.gleam`. Study and
uncomment the relevant code, and push your changes to pass the first stage:

```sh
Expand All @@ -32,8 +32,8 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `gleam (1.0)` installed locally
1. Ensure you have `gleam (1.0+)` installed locally
1. Run `./your_program.sh` to run your program, which is implemented in
`src/grep.gleam`.
`src/main.gleam`.
1. Commit your changes and run `git push origin master` to submit your solution
to CodeCrafters. Test output will be streamed to your terminal.
4 changes: 2 additions & 2 deletions compiled_starters/gleam/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ debug: false
# Use this to change the Gleam version used to run your code
# on Codecrafters.
#
# Available versions: gleam-1.0
language_pack: gleam-1.0
# Available versions: gleam-1.4
language_pack: gleam-1.4
12 changes: 2 additions & 10 deletions compiled_starters/gleam/gleam.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
name = "grep"
name = "codecrafters_grep"
version = "1.0.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "username", repo = "project" }
# links = [{ title = "Website", href = "https://gleam.run" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.
# https://gleam.run/writing-gleam/gleam-toml/.

[dependencies]
argv = ">= 1.0.2 and < 2.0.0"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion compiled_starters/gleam/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec gleam run -- "$@"
exec gleam run --module main -- "$@"
20 changes: 20 additions & 0 deletions dockerfiles/gleam-1.4.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1.7-labs
FROM ghcr.io/gleam-lang/gleam:v1.4.1-erlang-alpine

# Rebuild if gleam.toml or manifest.toml change
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="gleam.toml,manifest.toml"

WORKDIR /app

# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
COPY --exclude=.git --exclude=README.md . /app

# Force deps to be downloaded
RUN gleam build

# Cache build directory
RUN mkdir -p /app-cached
RUN mv build /app-cached/build

# Once the heavy steps are done, we can copy all files back
COPY . /app
2 changes: 1 addition & 1 deletion solutions/gleam/01-cq2/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec gleam run -- "$@"
exec gleam run --module main -- "$@"
6 changes: 3 additions & 3 deletions solutions/gleam/01-cq2/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ expressions are evaluated.

# Passing the first stage

The entry point for your `grep` implementation is in `src/grep.gleam`. Study and
The entry point for your `grep` implementation is in `src/main.gleam`. Study and
uncomment the relevant code, and push your changes to pass the first stage:

```sh
Expand All @@ -32,8 +32,8 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `gleam (1.0)` installed locally
1. Ensure you have `gleam (1.0+)` installed locally
1. Run `./your_program.sh` to run your program, which is implemented in
`src/grep.gleam`.
`src/main.gleam`.
1. Commit your changes and run `git push origin master` to submit your solution
to CodeCrafters. Test output will be streamed to your terminal.
4 changes: 2 additions & 2 deletions solutions/gleam/01-cq2/code/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ debug: false
# Use this to change the Gleam version used to run your code
# on Codecrafters.
#
# Available versions: gleam-1.0
language_pack: gleam-1.0
# Available versions: gleam-1.4
language_pack: gleam-1.4
12 changes: 2 additions & 10 deletions solutions/gleam/01-cq2/code/gleam.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
name = "grep"
name = "codecrafters_grep"
version = "1.0.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "username", repo = "project" }
# links = [{ title = "Website", href = "https://gleam.run" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.
# https://gleam.run/writing-gleam/gleam-toml/.

[dependencies]
argv = ">= 1.0.2 and < 2.0.0"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion solutions/gleam/01-cq2/code/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec gleam run -- "$@"
exec gleam run --module main -- "$@"
2 changes: 1 addition & 1 deletion solutions/gleam/01-cq2/explanation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The entry point for your grep implementation is in `src/grep.gleam`.
The entry point for your grep implementation is in `src/main.gleam`.

Study and uncomment the relevant code:

Expand Down
2 changes: 1 addition & 1 deletion starter_templates/gleam/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec gleam run -- "$@"
exec gleam run --module main -- "$@"
12 changes: 2 additions & 10 deletions starter_templates/gleam/code/gleam.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
name = "grep"
name = "codecrafters_grep"
version = "1.0.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "username", repo = "project" }
# links = [{ title = "Website", href = "https://gleam.run" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.
# https://gleam.run/writing-gleam/gleam-toml/.

[dependencies]
argv = ">= 1.0.2 and < 2.0.0"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions starter_templates/gleam/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
attributes:
required_executable: gleam (1.0)
user_editable_file: src/grep.gleam
required_executable: gleam (1.0+)
user_editable_file: src/main.gleam

0 comments on commit f655f81

Please sign in to comment.