From 93342253e1f85ea0be4c1f70ad4b28e018841a9c Mon Sep 17 00:00:00 2001 From: jwaldrip Date: Wed, 29 Apr 2020 20:30:56 -0600 Subject: [PATCH] ensure release if we build with production --- src/commands/build.cr | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/commands/build.cr b/src/commands/build.cr index 30e90b3c..afbdf292 100644 --- a/src/commands/build.cr +++ b/src/commands/build.cr @@ -25,11 +25,10 @@ module Shards private def build(target, options) Log.info { "Building: #{target.name}" } - args = [ - "build", - "-o", File.join(Shards.bin_path, target.name), - target.main, - ] + args = ["build", "-o", File.join(Shards.bin_path, target.name)] + args << "--release" if Shards.production? + args << target.main + options.each { |option| args << option } Log.debug { "crystal #{args.join(' ')}" }