Disable system startup files in zsh integration test with --noglobalrcs

This commit is contained in:
pagedown 2022-02-27 20:21:05 +08:00
parent 165c1240a9
commit 2d4f7e3446
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -50,9 +50,8 @@ def basic_shell_env(home_dir):
def safe_env_for_running_shell(argv, home_dir, rc='', shell='zsh'): def safe_env_for_running_shell(argv, home_dir, rc='', shell='zsh'):
ans = basic_shell_env(home_dir) ans = basic_shell_env(home_dir)
if shell == 'zsh': if shell == 'zsh':
argv.insert(1, '--noglobalrcs')
ans['ZLE_RPROMPT_INDENT'] = '0' ans['ZLE_RPROMPT_INDENT'] = '0'
with open(os.path.join(home_dir, '.zshenv'), 'w') as f:
print('unset GLOBAL_RCS', file=f)
with open(os.path.join(home_dir, '.zshrc'), 'w') as f: with open(os.path.join(home_dir, '.zshrc'), 'w') as f:
print(rc + '\n', file=f) print(rc + '\n', file=f)
setup_zsh_env(ans, argv) setup_zsh_env(ans, argv)