Skip to content

Commit 91d8d2b

Browse files
author
David Heinemeier Hansson
committed
Add bin/dev via foreman to run multiple processes
1 parent 948caa8 commit 91d8d2b

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

lib/install/Procfile.dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
web: bin/rails server
2+
js: yarn build --watch

lib/install/dev

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
foreman start -f Procfile.dev

lib/install/install.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,17 @@
2626
say "Add default package.json"
2727
copy_file "#{__dir__}/package.json", "package.json"
2828
end
29+
30+
if Rails.root.join("Procfile.dev").exist?
31+
append_to_file "Procfile.dev", "js: yarn build --watch"
32+
else
33+
say "Add default Procfile.dev"
34+
copy_file "#{__dir__}/Procfile.dev", "Procfile.dev"
35+
36+
say "Ensure foreman is installed"
37+
run "gem install foreman"
38+
end
39+
40+
say "Add bin/dev to start foreman"
41+
copy_file "#{__dir__}/dev", "bin/dev"
42+
chmod "bin/dev", 0755, verbose: false

0 commit comments

Comments
 (0)