Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create housekeeping command called ietoolkit #124

Closed
kbjarkefur opened this issue Feb 14, 2018 · 8 comments
Closed

create housekeeping command called ietoolkit #124

kbjarkefur opened this issue Feb 14, 2018 · 8 comments
Assignees
Labels
enhancement A new feature to be added to command resolved but not yet published Issue is fixed, but not yet published on SSC

Comments

@kbjarkefur
Copy link
Contributor

Team-Lupe has a nice addition to make sure that calls to SSC to install user-written commands are only done if needed, see https://github.com/worldbank/AFG-TUP/commit/62471a78d7fdfac049500fa49cc52755642aa01d. I like this approach. We should perhaps make it standard in the master do-file iefolder creates.

But as in the case of ietoolkit they cannot use the name ietoolkit as there is no command with that name. Should we create a command that does just do stuff like outputting which version of ietoolkit is installed? the command which does something similar, but strangely they do not store it in a local or something.

Creating the command should be straightforward.

We should let whoever was the first to do this in Team-Lupe to make the edit to iefolder if we end up using it so he or she get contributions credits. I can prepare the code and send it so this should take no time. @eatorange, who was the first to suggest this in Team-Lupe?

@kbjarkefur kbjarkefur self-assigned this Feb 14, 2018
@kbjarkefur kbjarkefur added the enhancement A new feature to be added to command label Feb 14, 2018
@eatorange
Copy link
Contributor

Hi @kbjarkefur , I am the one who first suggested it. Thanks for recognizing.
I was going to suggest this method as well, but somehow you found it by yourself!

@kbjarkefur
Copy link
Contributor Author

ok, I will see if @luizaandrade have any objections to this, but otherwise I will create a branch and make the update to iefolder but then send that file to you so you can make the commit and get contirbution credit as soon as it has merged to the master branch. It is easier that I do the update and send it to you as iefolder.ado is a beast...

@eatorange
Copy link
Contributor

eatorange commented Feb 14, 2018

That would be nice, as I still can't completely understand .ado file yet.

One thing I would like to comment is that, the codes currently confirming whether certain user-written commands exist (cap which ....) are executed before running global_setup.do file which sets custom ado file path. The problem is that, STATA will install user-written commands if it can't find them in default directory via which command, even if those commands actually exist in custom ado file paths.

One way we can solve is that, we can verify & install packages AFTER running global_setup.do file, thus STATA will install missing packages only after it searches custom ado-paths.

Another way is just leave it as it is. It is because even if STATA installs packages that are missing in default path but exist in custom ado-paths, STATA will always execute commands in the custom path first, because "adopath++ (custom path)" in the global_setup.do file let STATA prioritize the commands in the custom ado paths to default path (so doesn't really matter).

@kbjarkefur
Copy link
Contributor Author

I think it should be left as it is. It is good if it is installed even if it is not needed. Imagine someone who is less advanced Stata user that works in a project with someone like you who sets up custom paths sees a command used in that project, then goes to a different project and gets an error with exactly the same code. That would be confusing.

It is true that it could be small differences as custom paths guarantees the exact same version, but any version is better than no version.

@luizaandrade
Copy link
Member

This sounds great, @kbjarkefur and @eatorange! Please go ahead with the update to iefolder.

kbjarkefur added a commit that referenced this issue Feb 14, 2018
The locals in the command ietoolkit.ado must be updated with each publication as well now
kbjarkefur added a commit that referenced this issue Feb 14, 2018
kbjarkefur added a commit that referenced this issue Feb 14, 2018
kbjarkefur added a commit that referenced this issue Feb 14, 2018
@kbjarkefur
Copy link
Contributor Author

kbjarkefur commented Feb 14, 2018

I think the issue-124-ietoolkit-command is ready to be merged, but we can wait until we publish a new version in case we come up with something else to put in the ietoolkit command.

I think this is a cool usage of it. Where you can force an update of the package if the version installed is too old.

cap ietoolkit
if "`r(version)'" == "" {
   *ietoolkit not installed, install it
   ssc install ietoolkit
}
else if `r(version)' < 5.0 {
   ietoolkit version too old, install the latest version
   ssc install ietoolkit , replace
 }

But I think we should keeps Min's method in Master Do-file created by iefolder. I made it so it is a local of commands and it loops through all of them and check that they are installed. If version of ietoolkit is very important, then the code snippet above can be used afterwards or something.

eatorange added a commit to eatorange/ietoolkit that referenced this issue Feb 15, 2018
…ed ietoolkit

Updates to "iefolder" command
 - project master do-file, which the command creates, will install packages only if those packages are NOT installed in the system

Co-Authored-By: Kristoffer Bjärkefur <kbjarkefur@users.noreply.github.com>
kbjarkefur added a commit that referenced this issue Feb 15, 2018
iefolder : fix issue #124 - adds a part in iefolder that goes well with the new command ietoolkit
kbjarkefur added a commit that referenced this issue Mar 1, 2018
Issue #124 i- create ietoolkit command and edit iefolder so that master dofiles take advantage of this command
@kbjarkefur kbjarkefur added the resolved but not yet published Issue is fixed, but not yet published on SSC label Mar 1, 2018
@kbjarkefur
Copy link
Contributor Author

will close issue when update is published on SSC

@luizaandrade
Copy link
Member

Published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature to be added to command resolved but not yet published Issue is fixed, but not yet published on SSC
Projects
None yet
Development

No branches or pull requests

3 participants