ietoolkit icon indicating copy to clipboard operation
ietoolkit copied to clipboard

[ieboilstart]: Enhancements for schemes and adofiles

Open bbdaniels opened this issue 4 years ago • 2 comments

Some more boiler code that we have found useful with @MRuzzante for setting up graph schemes and clearing and loading adofiles.

sysdir set PLUS "${directory}/ado/"
sysdir set PERSONAL "${directory}/"

local subDirs : dir "${do}/ado/" dirs "*"
   local subDirs  = subinstr(`" `subDirs' "', `"""' , "" , .)
   foreach subDir of local subDirs {
     local   adoFiles  : dir "${do}/ado/`subDir'" files "*.ado"
     local   adoFiles  = subinstr(`" `adoFiles' "', `"""' , "" , .)
     foreach adoFile of local adoFiles {
       qui do "${do}/ado/`subDir'/`adoFile'"
   }
}

bbdaniels avatar Aug 15 '20 18:08 bbdaniels

Where would ${directory} and ${do} come from? and are we sure we always wants to do this? This might overwrite some other setup. Nothing ieboilstart does today overwrite anything that is needed to run your code. just system settings that just make sure that you do not have some stupid memory setting...

kbjarkefur avatar Aug 17 '20 01:08 kbjarkefur

Those don't necessarily need to be the same here, it's just the globals that we'd used in respective setups. But it would be nice to be able to set the PLUS and PERSONAL paths to (1) the location where ado files should be installed to the project; and (2) the location where graph scheme is stored for the project (respectively). Then the second part runs all the ado files it finds (this can probably be modified to use PLUS correctly). So ideally this sets up those Stata components without overwriting anything else. But it does need the two paths to be provided.

Edit: And no, we probably would not always want to do this, but almost always in a finished project I want this to be done. The main thing I find that is needed is cleanup of all the user-installed commands because doing this part during the work means you end up with lots of ado files in there that you don't need (although you then also build them out as you work rather than having to do it at the end). So the tool you had talked about that searches everything up would be cool.

bbdaniels avatar Aug 17 '20 15:08 bbdaniels