-
-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add overmind as the first option to run
Changes: - Use Ruby instead of bash script for cross-platform use - Prefer Overmind over Foreman - Show relevant messages if both Overmind and Foreman not installed and if Procfile missing
- Loading branch information
Showing
2 changed files
with
60 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,32 @@ | ||
#!/usr/bin/env bash | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
if ! command -v foreman &> /dev/null | ||
then | ||
echo "Installing foreman…" | ||
gem install foreman && echo "Foreman Installed." | ||
fi | ||
def installed?(process) | ||
IO.popen "#{process} -v" | ||
rescue Errno::ENOENT | ||
false | ||
end | ||
|
||
foreman start -f Procfile.dev | ||
def run(process) | ||
argv = ARGV.join(" ") | ||
puts "Using #{process}" | ||
exec "#{process} start -f Procfile.dev", argv | ||
rescue Errno::ENOENT | ||
puts <<~MSG | ||
ERROR: | ||
Please ensure `Procfile.dev` exist in your project! | ||
MSG | ||
exit! | ||
end | ||
|
||
if installed? "overmind" | ||
run "overmind" | ||
elsif installed? "foreman" | ||
run "foreman" | ||
else | ||
puts <<~MSG | ||
NOTICE: | ||
For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them. | ||
MSG | ||
exit! | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,32 @@ | ||
#!/usr/bin/env bash | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
if ! command -v foreman &> /dev/null | ||
then | ||
echo "Installing foreman…" | ||
gem install foreman && echo "Foreman Installed." | ||
fi | ||
def installed?(process) | ||
IO.popen "#{process} -v" | ||
rescue Errno::ENOENT | ||
false | ||
end | ||
|
||
foreman start -f Procfile.dev-static | ||
def run(process) | ||
argv = ARGV.join(" ") | ||
puts "Using #{process}" | ||
exec "#{process} start -f Procfile.dev-static", argv | ||
rescue Errno::ENOENT | ||
puts <<~MSG | ||
ERROR: | ||
Please ensure `Procfile.dev-static` exist in your project! | ||
MSG | ||
exit! | ||
end | ||
|
||
if installed? "overmind" | ||
run "overmind" | ||
elsif installed? "foreman" | ||
run "foreman" | ||
else | ||
puts <<~MSG | ||
NOTICE: | ||
For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them. | ||
MSG | ||
exit! | ||
end |