mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(tools): do not include rc scripts in export script
The rc scripts should be included only when a new shell is started. At present, for bash and zsh, we are also including them in the export scripts, which is incorrect and may cause recursion. Closes https://github.com/espressif/esp-idf/issues/14584 Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
parent
eb606b9777
commit
2109f81102
@ -72,10 +72,6 @@ class UnixShell(Shell):
|
||||
# Basic POSIX shells does not support autocompletion
|
||||
return None
|
||||
|
||||
def init_file(self) -> None:
|
||||
with open(self.script_file_path, 'w') as fd:
|
||||
self.export_file(fd)
|
||||
|
||||
def export_file(self, fd: TextIO) -> None:
|
||||
fd.write(f'{self.deactivate_cmd}\n')
|
||||
for var, value in self.new_esp_idf_env.items():
|
||||
@ -87,7 +83,8 @@ class UnixShell(Shell):
|
||||
'Go to the project directory and run:\n\n idf.py build"\n'))
|
||||
|
||||
def export(self) -> None:
|
||||
self.init_file()
|
||||
with open(self.script_file_path, 'w') as fd:
|
||||
self.export_file(fd)
|
||||
print(f'. {self.script_file_path}')
|
||||
|
||||
def click_ver(self) -> int:
|
||||
@ -188,6 +185,10 @@ class FishShell(UnixShell):
|
||||
stdout: str = run_cmd([sys.executable, conf.IDF_PY], env=env)
|
||||
return stdout
|
||||
|
||||
def init_file(self) -> None:
|
||||
with open(self.script_file_path, 'w') as fd:
|
||||
self.export_file(fd)
|
||||
|
||||
def spawn(self) -> None:
|
||||
self.init_file()
|
||||
new_env = os.environ.copy()
|
||||
|
Loading…
Reference in New Issue
Block a user