So, I am trying to create an alias to open the browser in a specific URL for me when I run the pr command on my command line.
function pr() {
repoName=(basename `git rev-parse --show-toplevel`)
branchName=(`git rev-parse --abbrev-ref HEAD`)
$repoName <- printing a-public
$branchName <- printing acq-248
open -a "Google Chrome" "https://bitbucket.org/company/$repoName/pull-requests/new?source=$branchName&event_source=branch_list"
}
So, when I run pr, I can see the $repoName and the $branchName has the right value, but the opened url does interprets it partially -> https://bitbucket.org/company/Users/v/projs/a-public/pull-requests/new?source=acq-248&event_source=branch_list
So, what would be the right way of passing these variables to concatenate into the URL I wanna open ?