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

Fix bourne shell compatibility issues #133

Merged
merged 2 commits into from
Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jupyter_forward/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _launch_jupyter(self):
'[bold green]Running jupyter sanity checks (ensuring `jupyter` is in `$PATH`)',
characters='*',
)
check_jupyter_status = 'sh -c "command -v jupyter"'
check_jupyter_status = 'sh -l -c "command -v jupyter"'
conda_activate_cmd = 'source activate'
if self.conda_env:
try:
Expand Down Expand Up @@ -204,7 +204,7 @@ def _launch_jupyter(self):
command = r'jupyter lab --no-browser --ip=\$(hostname -f)'
if self.notebook_dir:
command = f'{command} --notebook-dir={self.notebook_dir}'
command = f'{command} >& {self.log_file}'
command = f'{command} > {self.log_file} 2>&1'
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm concerned that this change is not compatible with tcsh and is actually reintroducing a bug fixed in #67. @tobias-haenel what sort of error do you see if you add the -l argument but keep the >& notation?

@andersy005 we should try to figure out how to create a test suite for jupyter-forward to prevent regressions like this... I suspect it can't be fully automated, but we definitely need to make sure all PRs are compatible with both bash and tcsh before accepting them

if self.conda_env:
command = f'{conda_activate_cmd} {self.conda_env} && {command}'

Expand Down