Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

push: use given command even if Procfile exists

[finishes #45887129]
  • Loading branch information...
commit 317a7cfc73ea3c023aa9f2251316838a72efc6c3 1 parent 23027e9
Alex Suraci & Chris Brown authored
View
2  lib/vmc/cli/app/push/create.rb
@@ -13,7 +13,7 @@ def get_inputs
if v2?
inputs[:production] = !!(input[:plan] =~ /^p/i)
- inputs[:command] = input[:command] unless has_procfile?
+ inputs[:command] = input[:command] if input.has?(:command) || !has_procfile?
framework = detector.detect_framework
else
View
22 spec/vmc/cli/app/push/create_spec.rb
@@ -65,6 +65,28 @@
its([:buildpack]) { should eq "git://example.com" }
end
+ context 'when the command is given' do
+ context "and there is a Procfile in the application's root" do
+ before do
+ FakeFS.activate!
+ Dir.mkdir(path)
+
+ # fakefs removes fnmatch :'(
+ stub(create.send(:detector)).detect_framework
+ File.open("#{path}/Procfile", "w") do |file|
+ file.write("this is a procfile")
+ end
+ end
+
+ after do
+ FakeFS.deactivate!
+ FakeFS::FileSystem.clear
+ end
+
+ its([:command]) { should eq "ruby main.rb" }
+ end
+ end
+
context 'when certain inputs are not given' do
it 'asks for the name' do
inputs.delete(:name)
Please sign in to comment.
Something went wrong with that request. Please try again.