Skip to content

Commit

Permalink
Better bin setup (#35)
Browse files Browse the repository at this point in the history
* Set up .env file first, before running Rails commands

* Properly indent multi-line strings passed to say_status
  • Loading branch information
mattbrictson authored Jan 13, 2024
1 parent a7867da commit 3f05bfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions template/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this method.
def setup!
env ".env", from: ".env.sample"
run "bundle install" if bundle_needed?
run "overcommit --install" if overcommit_installable?
run "bin/rails db:prepare" if database_present?
run "yarn install" if yarn_needed?
run "bin/rails tmp:create" if tmp_missing?
env ".env", from: ".env.sample"
run "bin/rails restart"

if git_safe_needed?
Expand Down Expand Up @@ -84,7 +84,7 @@ end

def say_status(label, message, color = :green)
label = label.to_s.rjust(12)
puts [colorize(label, color), message].join(" ")
puts [colorize(label, color), message.gsub(/^/, " " * 13).strip].join(" ")
end

def colorize(str, color)
Expand Down

0 comments on commit 3f05bfb

Please sign in to comment.