Skip to content

Commit 42f96b4

Browse files
committed
fix(repl): corrected start of repl command if there is no robot.toml with a path setting
1 parent fda1f02 commit 42f96b4

File tree

1 file changed

+12
-13
lines changed
  • packages/repl/src/robotcode/repl/cli

1 file changed

+12
-13
lines changed

packages/repl/src/robotcode/repl/cli/repl.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ def run_repl(
3636
variablefile: Tuple[str, ...],
3737
pythonpath: Tuple[str, ...],
3838
outputdir: Optional[str],
39-
paths: Tuple[Path, ...],
39+
files: Tuple[Path, ...],
4040
) -> None:
4141
robot_options_and_args: Tuple[str, ...] = ()
4242

43+
if files:
44+
files = tuple(f.absolute() for f in files)
45+
4346
for var in variable:
4447
robot_options_and_args += ("--variable", var)
4548
for varfile in variablefile:
@@ -49,17 +52,13 @@ def run_repl(
4952
if outputdir:
5053
robot_options_and_args += ("--outputdir", outputdir)
5154

52-
root_folder, profile, cmd_options = handle_robot_options(app, robot_options_and_args)
55+
root_folder, profile, cmd_options = handle_robot_options(app, (*robot_options_and_args, *(str(f) for f in files)))
5356

5457
try:
5558

56-
options, arguments = RobotFrameworkEx(
59+
options, _ = RobotFrameworkEx(
5760
app,
58-
(
59-
[*(app.config.default_paths if app.config.default_paths else ())]
60-
if profile.paths is None
61-
else profile.paths if isinstance(profile.paths, list) else [profile.paths]
62-
),
61+
["."],
6362
app.config.dry,
6463
root_folder,
6564
).parse_arguments((*cmd_options, *robot_options_and_args))
@@ -71,7 +70,7 @@ def run_repl(
7170
report=None,
7271
quiet=True,
7372
listener=[
74-
ReplListener(app, Interpreter(app, files=list(paths), inspect=inspect)),
73+
ReplListener(app, Interpreter(app, files=list(files), inspect=inspect)),
7574
],
7675
)
7776

@@ -147,8 +146,8 @@ def run_repl(
147146
help="Activate inspection mode. This forces a prompt to appear after the REPL script is executed.",
148147
)
149148
@click.argument(
150-
"paths",
151-
type=click.Path(exists=True, path_type=Path),
149+
"files",
150+
type=click.Path(exists=True, dir_okay=False, path_type=Path),
152151
nargs=-1,
153152
required=False,
154153
)
@@ -160,10 +159,10 @@ def repl(
160159
pythonpath: Tuple[str, ...],
161160
outputdir: Optional[str],
162161
inspect: bool,
163-
paths: Tuple[Path, ...],
162+
files: Tuple[Path, ...],
164163
) -> None:
165164
"""\
166165
Run Robot Framework interactively.
167166
"""
168167

169-
run_repl(app, inspect, variable, variablefile, pythonpath, outputdir, paths)
168+
run_repl(app, inspect, variable, variablefile, pythonpath, outputdir, files)

0 commit comments

Comments
 (0)