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

Minor improvements to generated bin/setup script #35

Merged
merged 2 commits into from
Jan 13, 2024
Merged
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
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