Skip to content

Commit e30b063

Browse files
committed
chore: os agnostic dir checking for cli commands
1 parent 5b566e2 commit e30b063

4 files changed

Lines changed: 13 additions & 10 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.1.6"
3+
version = "2.1.7"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath/_cli/cli_pack.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ def display_project_info(config):
276276

277277

278278
@click.command()
279-
@click.argument("root", type=str, default="./")
279+
@click.argument(
280+
"root", type=click.Path(exists=True, file_okay=False, dir_okay=True), default="."
281+
)
280282
@click.option(
281283
"--nolock",
282284
is_flag=True,

src/uipath/_cli/cli_pull.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@
2020
from dotenv import load_dotenv
2121

2222
from .._utils._ssl_context import get_httpx_client_kwargs
23-
from .._utils._url import UiPathUrl
2423
from ..telemetry import track
25-
from ._utils._common import get_env_vars
24+
from ._utils._common import get_env_vars, get_org_scoped_url
2625
from ._utils._console import ConsoleLogger
2726
from ._utils._studio_project import (
2827
ProjectFile,
@@ -142,7 +141,9 @@ def download_folder_files(
142141

143142

144143
@click.command()
145-
@click.argument("root", type=str, default="./")
144+
@click.argument(
145+
"root", type=click.Path(exists=True, file_okay=False, dir_okay=True), default="."
146+
)
146147
@track
147148
def pull(root: str) -> None:
148149
"""Pull remote project files from Studio Web Project.
@@ -166,17 +167,15 @@ def pull(root: str) -> None:
166167
console.error("UIPATH_PROJECT_ID environment variable not found.")
167168

168169
[base_url, token] = get_env_vars()
169-
uipath_url = UiPathUrl(base_url)
170-
org_scoped_base_url = uipath_url.scope_url("org")
171-
base_api_url = f"{org_scoped_base_url}/studio_/backend/api/Project/{os.getenv('UIPATH_PROJECT_ID')}/FileOperations"
170+
base_api_url = f"{get_org_scoped_url(base_url)}/studio_/backend/api/Project/{os.getenv('UIPATH_PROJECT_ID')}/FileOperations"
172171

173172
with console.spinner("Pulling UiPath project files..."):
174173
try:
175174
with httpx.Client(**get_httpx_client_kwargs()) as client:
176175
# Get project structure
177176
structure = get_project_structure(
178177
os.getenv("UIPATH_PROJECT_ID"), # type: ignore
179-
org_scoped_base_url,
178+
get_org_scoped_url(base_url),
180179
token,
181180
client,
182181
)

src/uipath/_cli/cli_push.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ def upload_source_files_to_project(
492492

493493

494494
@click.command()
495-
@click.argument("root", type=str, default="./")
495+
@click.argument(
496+
"root", type=click.Path(exists=True, file_okay=False, dir_okay=True), default="."
497+
)
496498
@click.option(
497499
"--nolock",
498500
is_flag=True,

0 commit comments

Comments
 (0)