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

Support old stata -b mode where stdout was written to a log file. #8

Merged
merged 2 commits into from
May 11, 2021

Conversation

bloodearnest
Copy link
Member

It may be that users are include the current log file stuff in their
outputs.

It may be that users are include the current log file stuff in their
outputs.
entrypoint.sh Outdated

# batch mode writes output for script.do to script.log, so we preserve that
# behaviour
log=${script%.do}.log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Stata uses just the script filename and not the full path to determine the log file, so the log file always get written in the cwd regardless of where the script is:
https://www.statalist.org/forums/forum/general-stata-discussion/general/1354640-can-i-control-the-location-of-log-file-in-batch-mode

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course it does.

Fixed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to know how Stata behaves you can just ask yourself, "How could Stata make my life more difficult in this situation?"

It occurs to me, btw, that both this and the wrapped.$script thing might have been caught by the tests if the test scripts ran from a subdir of the cwd.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It occurred to me too, which is why I added in the last commit :)

Unless you meant something different?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Totally missed that! Sorry! Though great minds etc

Also, move the test scripts into a subdirect to ensure we test using
directories in the path properly
@bloodearnest bloodearnest merged commit 093b675 into main May 11, 2021
@bloodearnest bloodearnest deleted the preserve-log branch May 11, 2021 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants