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

bin/setup: Skip rails restart step if server isn't running #112

Merged
merged 1 commit into from
Sep 17, 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
6 changes: 5 additions & 1 deletion template/bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def setup!
run "bin/rails db:prepare" if database_present?
run "yarn install --check-files" if yarn_needed?
run "bin/rails tmp:create" if tmp_missing?
run "bin/rails restart"
run "bin/rails restart" if pid_present?

if git_safe_needed?
say_status :notice,
Expand Down Expand Up @@ -56,6 +56,10 @@ def tmp_missing?
!Dir.exist?("tmp/pids")
end

def pid_present?
Dir["tmp/pids/*.pid"].any?
end

def git_safe_needed?
ENV["PATH"].include?(".git/safe/../../bin") && !Dir.exist?(".git/safe")
end
Expand Down