paulirish / git-open

Type `git open` to open the GitHub page or website for a repository in your browser.
MIT License
3.29k stars 246 forks source link

Customization option of url needed. #181

Open yunsangr opened 3 years ago

yunsangr commented 3 years ago

Customization option of url needed since the keyword "tree" is added to the url by default it does not work with some repo websites, which is yona in my case.

This is the output when i type git open -p

➜  git open -p           
http://yona.linewalks.com/myName/myRepoName/tree/myBranchName

but to work in yona, the url has to be the following below. http://yona.linewalks.com/myName/myRepoName/code/myBranchName

So, just adding the customization to the url, it might work with other platforms too. I suggest the following options as examples.

➜  git open --default_url      
http://yona.linewalks.com/myName/myRepoName ( 0 )
http://yona.linewalks.com/myName/myRepoName/tree/myBranchName ( x )
-> git  open --remove_keyword=tree
http://yona.linewalks.com/myName/myRepoName/myBranchName ( O )
http://yona.linewalks.com/myName/myRepoName/tree/myBranchName ( x )
-> git  open --replace_keyword=tree --replace_with=code   
http://yona.linewalks.com/myName/myRepoName/code/myBranchName ( O )
http://yona.linewalks.com/myName/myRepoName/tree/myBranchName ( x )