Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug with release being undefined and adds --no-debug to production run #307

Merged
merged 4 commits into from
Oct 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/amber/cli/commands/run.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ module Amber::CLI
end

def run
release = "--release" if options.e.downcase == "production"
puts colorize("💎 Crystalizing...", :dark_gray)
`crystal build #{release} $(ls ./src/*.cr | sort -n | head -1) -o app`
compile_command = "crystal build $(ls ./src/*.cr | sort -n | head -1) -o app"
compile_command += " --release --no-debug" if %w(development test).includes?(options.e.downcase)
system(compile_command)
puts colorize("💎 Crystalization complete!", :dark_gray)
Process.run(
"PORT=#{options.p} AMBER_ENV=#{options.e} ./app",
Expand Down