diff --git a/libs/interpreter_lib.py b/libs/interpreter_lib.py index eae11f2..0ac5f2b 100644 --- a/libs/interpreter_lib.py +++ b/libs/interpreter_lib.py @@ -373,6 +373,7 @@ def interpreter_main(self): self.logger.info(f"Code Interpreter - v{self.interpreter_version}") os_platform = self.utility_manager.get_os_platform() os_name = os_platform[0] + extracted_code = None # Seting the mode. if self.SCRIPT_MODE: @@ -446,16 +447,16 @@ def interpreter_main(self): self.logger.info(f"Opening code in **vim** editor {code_file}") subprocess.call(['vim', code_file]) continue - - # Open the code in default editor. - if os_platform[0].lower() == 'macos': - self.logger.info(f"Opening code in default editor {code_file}") - subprocess.call(('open', code_file)) - elif os_platform[0].lower() == 'linux': - subprocess.call(('xdg-open', code_file)) - elif os_platform[0].lower() == 'windows': - os.startfile(code_file) - continue + else: + # Open the code in default editor. + if os_platform[0].lower() == 'macos': + self.logger.info(f"Opening code in default editor {code_file}") + subprocess.call(('open', code_file)) + elif os_platform[0].lower() == 'linux': + subprocess.call(('xdg-open', code_file)) + elif os_platform[0].lower() == 'windows': + os.startfile(code_file) + continue # MODE - Command section. elif any(command in task.lower() for command in ['/mode ', '/md ']):