Skip to content

Commit 6cab870

Browse files
committed
[sparckles#654] review: refactor EventHandler#reload
1 parent 78b9dda commit 6cab870

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

robyn/reloader.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@ def reload(self):
118118
self.built_rust_binaries = compile_rust_files(self.directory_path)
119119

120120
if self.config.dev and self.config.file_path is not None:
121-
subprocess.call(f'cd {"/".join(self.config.file_path.split("/")[-2:-1])}', shell=True)
121+
split = self.config.file_path.split("/")
122+
123+
working_directory = "/".join(split[-2:-1])
124+
125+
subprocess.call(f"cd {working_directory}", shell=True)
126+
122127
self.process = subprocess.Popen(
123-
[sys.executable, "-m", self.config.file_path.split("/")[-2], *arguments],
128+
[sys.executable, "-m", split[-2], *arguments],
124129
env=new_env,
125130
start_new_session=False,
126131
)

0 commit comments

Comments
 (0)