-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: implement source
#102
Conversation
Probably time to fix #82. :) And define the exact semantics with tests, and we can always check that Bash behaves the same way. I think the current semantics is correct, I think sourcing a script is equivalent to copy & pasting the script into the parent script and execute there. |
I tested this on Windows and it works! I can now load I think this unblocks me, I can now create scripts for various conda environments, and this might be all that was needed to start using shell for my daily work. |
Found a bug: #113. |
let stdout = ShellPipeWriter::stdout(); | ||
let stdin = ShellPipeReader::stdin(); | ||
|
||
if let Err(e) = list { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wolfv Is there any reason we are bailing on syntax errors? This causes shell to exit on syntax errors in interactive mode.
Previously the error was being written to stderr
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might want to catch the error somewhere upstream!
Fixes #94.
I am not sure about the exact semantics. Currently, everything that is modified in the sourced' script is also going to be modified in the parent script.