poidstotal / stataRun

Provide a Visual Studio Code extension to run code(.do, .ado and command from) for Visual Studio Editor
25 stars 8 forks source link

Working directory not changed #7

Closed bobbyinfj closed 4 years ago

bobbyinfj commented 5 years ago

First off, thank you for this extension. It's great to be able to use Visual Studio Code with Stata and run commands directly from it!

One issue I am facing on MacOS is, usually, the working directory in STATA is set to the location of the do file when it is run. Is there an option or way to default to this functionality?

Thank you!

poidstotal commented 5 years ago

Hi, I'm not sure If understand well, but this sounds like something you can fix in Stata. the module uses same working directory as the Stata editor. So regardless their current location, do file will work the same way as if there were run from Stata Editor. Perhaps if you can elaborate further on the issue, I can provide more helpful assistance. Let me know.

Gratitudes Gilbert M.

bobbyinfj commented 5 years ago

Hi Gilbert,

Thank you for your reply! Yes, I was expecting running a do file to change the working directory. e.g.

if a file existed on the desktop/ I would expect it to change the directory to desktop/ when being run so that the relative file references remain intact (I collaborate on a fileshare server with a nested folder structure and multiple users modifying files).

But perhaps I just need to develop the habit of manually changing the directory to whatever file is being run.

Thank you again.

-Robert

poidstotal commented 4 years ago

Hi Robert, Sorry for the delay in replying. I understand what you want, but it can backfire for some usage. Actually the do file editor of Stata doesn't do that either.

Gratitudes Gilbert M.