mirror of
https://github.com/adusak/bitbucket-git-helpers.plugin.zsh.git
synced 2026-01-14 12:43:24 +01:00
28 lines
647 B
Ruby
Executable File
28 lines
647 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
#
|
|
# Open the PR page on bitbucket for the current repository
|
|
#
|
|
# Copyright 2016 Joe Block <jpb@unixorn.net>
|
|
#
|
|
# License: Apache 2.0
|
|
|
|
require 'pathname'
|
|
require_relative 'githelpers'
|
|
|
|
def construct_PR_list_URL
|
|
remote = git_remote()
|
|
bbloc = remote.index('bitbucket.org')
|
|
if not bbloc
|
|
puts "Only works for repositories with their origin remote on bitbucket.org"
|
|
exit 1
|
|
end
|
|
return "https://#{remote[bbloc..-5].sub(':','/')}/pull-requests/"
|
|
end
|
|
|
|
if ARGV.length > 0
|
|
puts 'Usage: git-bb-list-pull-requests'
|
|
puts ' Opens the PR page on bitbucket for the current repository'
|
|
end
|
|
|
|
openURL(construct_PR_list_URL())
|