Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/amber/cli/commands/exec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module Amber::CLI
spawn show
process = Process.run(code, shell: true, output: file, error: file)
sleep 1.millisecond
process.exit_status
process.exit_code
end

private def wrap(code)
Expand Down
8 changes: 4 additions & 4 deletions src/amber/cli/helpers/process_runner.cr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module Sentry
@build_commands = Hash(String, String).new, # { "task1" => [ ... ], "task2" => [ ... ] }
@run_commands = Hash(String, String).new, # { "task1" => [ ... ], "task2" => [ ... ] }
@includes = Hash(String, Array(String)).new, # { "task1" => [ ... ], "task2" => [ ... ] }
@excludes = Hash(String, Array(String)).new # { "task1" => [ ... ], "task2" => [ ... ] }
@excludes = Hash(String, Array(String)).new, # { "task1" => [ ... ], "task2" => [ ... ] }
)
@app_running = false
end
Expand All @@ -25,7 +25,7 @@ module Sentry
loop do
scan_files
check_processes
sleep 1
sleep 1.second
end
end

Expand Down Expand Up @@ -120,11 +120,11 @@ module Sentry
ok_to_run = true
else
log :run, "Building..."
time = Time.monotonic
time = Time.instant
build_result = Amber::CLI::Helpers.run(build_command_run)
exit 1 unless build_result.is_a? Process::Status
if build_result.success?
log :run, "Compiled in #{(Time.monotonic - time)}"
log :run, "Compiled in #{(Time.instant - time)}"
stop_processes("run") if @app_running
ok_to_run = true
elsif !@app_running # first run
Expand Down
6 changes: 3 additions & 3 deletions src/amber/dsl/router.cr
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ module Amber::DSL

{% for verb in RESOURCES %}
macro {{verb.id}}(*args)
route {{verb}}, \{{*args}}
route {{verb}}, \{{args.splat}}
{% if verb == :get %}
route :head, \{{*args}}
route :head, \{{args.splat}}
{% end %}
{% if ![:trace, :connect, :options, :head].includes? verb %}
route :options, \{{*args}}
route :options, \{{args.splat}}
{% end %}
end
{% end %}
Expand Down