Skip to content

Commit 7d226dc

Browse files
committed
wip
1 parent 6493421 commit 7d226dc

File tree

8 files changed

+40
-17
lines changed

8 files changed

+40
-17
lines changed

Diff for: compiled_starters/elixir/lib/main.ex

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# Uncomment this block to pass the first stage
2-
# IO.write("$ ")
1+
defmodule CLI do
2+
def main(_args) do
3+
# Uncomment this block to pass the first stage
4+
IO.write("$ ")
35

4-
# Wait for user input
5-
IO.read(:line)
6+
# Wait for user input
7+
IO.read(:line)
8+
end
9+
end

Diff for: compiled_starters/elixir/mix.exs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ defmodule App.MixProject do
77
app: :codecrafters_shell,
88
version: "1.0.0",
99
elixir: "~> 1.17",
10+
escript: [main_module: CLI],
1011
start_permanent: Mix.env() == :prod,
1112
deps: deps()
1213
]

Diff for: dockerfiles/elixir-1.17.Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ COPY --exclude=.git --exclude=README.md . /app
1212
# Install & cache deps
1313
RUN .codecrafters/compile.sh
1414

15+
# If _build directory exists, move it to /app-cached
16+
RUN mkdir -p /app-cached
17+
RUN if [ -d "/app/_build" ]; then mv /app/_build /app-cached; fi
18+
1519
# Once the heavy steps are done, we can copy all files back
1620
COPY . /app

Diff for: solutions/elixir/01-oo8/code/lib/main.ex

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
IO.write("$ ")
1+
defmodule CLI do
2+
def main(_args) do
3+
IO.write("$ ")
24

3-
# Wait for user input
4-
IO.read(:line)
5+
# Wait for user input
6+
IO.read(:line)
7+
end
8+
end

Diff for: solutions/elixir/01-oo8/code/mix.exs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ defmodule App.MixProject do
77
app: :codecrafters_shell,
88
version: "1.0.0",
99
elixir: "~> 1.17",
10+
escript: [main_module: CLI],
1011
start_permanent: Mix.env() == :prod,
1112
deps: deps()
1213
]

Diff for: solutions/elixir/01-oo8/diff/lib/main.ex.diff

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
@@ -1,5 +1,4 @@
2-
-# Uncomment this block to pass the first stage
3-
-# IO.write("$ ")
4-
+IO.write("$ ")
1+
@@ -1,9 +1,8 @@
2+
defmodule CLI do
3+
def main(_args) do
4+
- # Uncomment this block to pass the first stage
5+
- # IO.write("$ ")
6+
+ IO.write("$ ")
57

6-
# Wait for user input
7-
IO.read(:line)
8+
# Wait for user input
9+
IO.read(:line)
10+
end
11+
end

Diff for: starter_templates/elixir/code/lib/main.ex

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# Uncomment this block to pass the first stage
2-
# IO.write("$ ")
1+
defmodule CLI do
2+
def main(_args) do
3+
# Uncomment this block to pass the first stage
4+
# IO.write("$ ")
35

4-
# Wait for user input
5-
IO.read(:line)
6+
# Wait for user input
7+
IO.read(:line)
8+
end
9+
end

Diff for: starter_templates/elixir/code/mix.exs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ defmodule App.MixProject do
77
app: :codecrafters_shell,
88
version: "1.0.0",
99
elixir: "~> 1.17",
10+
escript: [main_module: CLI],
1011
start_permanent: Mix.env() == :prod,
1112
deps: deps()
1213
]

0 commit comments

Comments
 (0)