haghish / github

a module for building, searching, installing, managing, and mining Stata packages from GitHub
http://haghish.github.io/github/
101 stars 41 forks source link

add replace option in `net install package` #13

Closed randrescastaneda closed 4 years ago

randrescastaneda commented 4 years ago

Dear @haghish ,

I just added option replace when downloading from github repo and package has been downloaded previously from SSC. Now, if the user has the version in SSC and wants to download the version in Github, she can do it by just adding the option replace.

Best,

haghish commented 4 years ago

HI Andres,

About the first commit, I cannot see why you have tried to rename the version of the downloaded packages. there is no "v" in the version name.

Second, about adding the replace option, if you see in the code, before installing a package from GitHub, there is a code for uninstalling it from Stata (by default), which was what the community asked me to do. So adding the replace option is redundant.

That said, I appreciate it that you have reviewed the code. Please feel free to further these additions if you think I am wrong.

randrescastaneda commented 4 years ago

Hi Haghish,

Thank you so much for your email. I probably misunderstood the code, so my suggestions are not correct or do not work properly to solve the issues I am facing. Basically, if I remember correctly, I am added this suggestions because the github command does not allow me to install from Github if the package is already installed from ssc.

Take for instance the command povcalnet, which is a wrapper of the World Bank povcalnet API. It is available in SCC and in Github as well. As you can see at the beginning of the code, the povcalnet finds where it was install from and then checks whether there is an update from that particular source. However, if I have it installed from ssc and then I want to install it from github, the github commands fails.

Regarding the “v” in the version name, it is true that it is not necessary, but some packages include it. Unfortunately, the povcalnet command is one of those packages. I think I might be able to change that, but it is worth considering adding that small feature that does not affect the code in general and actually allows more flexible versioning conventions.

Thank you so much for taking the time to review my suggestions. Best,

R.Andrés Castañeda