Skip to content
Open
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
25 changes: 13 additions & 12 deletions lib/middleman-deploy/strategies/git/force_push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,22 @@ def add_remote_url
end

def get_remote_url
remote = self.remote
url = remote
Dir.chdir('..') do
url = remote

# check if remote is not a git url
unless remote =~ /\.git$/
url = `git config --get remote.#{url}.url`.chop
end
# check if remote is not a git url
unless url.end_with?('.git')
url = `git config --get remote.#{remote}.url`.chop
end

# if the remote name doesn't exist in the main repo
if url == ''
puts "Can't deploy! Please add a remote with the name '#{remote}' to your repo."
exit
end
# if the remote name doesn't exist in the main repo
if url == ''
puts "Can't deploy! Please add a remote with the name '#{remote}' to your repo."
exit
end

url
url
end
end
end
end
Expand Down