Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions nbs/00_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
" except PlashError as e: print(f\"Error: {str(e)}\\nInvalid path: {path}\"); return\n",
" \n",
" try: \n",
" if not name: name = get_app_name(path)\n",
" if not name: name = _get_app_name(path)\n",
" except FileNotFoundError:\n",
" plash_app = path / '.plash'\n",
" name = _gen_app_name()\n",
Expand Down Expand Up @@ -517,7 +517,7 @@
" name:str=None, # Overrides the .plash file in project root if provided\n",
" force:bool=False): # Skip confirmation prompt\n",
" 'Delete your deployed app'\n",
" if not name: name = get_app_name(path)\n",
" if not name: name = _get_app_name(path)\n",
" if not force:\n",
" confirm = input(f\"Are you sure you want to delete app '{name}'? This action cannot be undone. [y/N]: \")\n",
" if confirm.lower() not in ['y', 'yes']:\n",
Expand Down Expand Up @@ -575,7 +575,7 @@
"@call_parse\n",
"def start(path:Path=Path('.'), name:str=None):\n",
" \"Start your deployed app\"\n",
" if not name: name = get_app_name(path)\n",
" if not name: name = _get_app_name(path)\n",
" r = _mk_auth_req(_endpoint(rt=f\"/start?name={name}\"))\n",
" return r.text"
]
Expand Down Expand Up @@ -625,7 +625,7 @@
"@call_parse \n",
"def stop(path:Path=Path('.'), name:str=None):\n",
" \"Stop your deployed app\" \n",
" if not name: name = get_app_name(path)\n",
" if not name: name = _get_app_name(path)\n",
" r = _mk_auth_req(_endpoint(rt=f\"/stop?name={name}\"))\n",
" return r.text"
]
Expand Down Expand Up @@ -759,7 +759,7 @@
" name:str=None, # Overrides the .plash file in project root if provided\n",
" save_path:Path=Path(\"./download/\")): # Save path (optional)\n",
" 'Download your deployed app'\n",
" if not name: name = get_app_name(path)\n",
" if not name: name = _get_app_name(path)\n",
" try: save_path.mkdir(exist_ok=False)\n",
" except: print(f\"ERROR: Save path ({save_path}) already exists. Please rename or delete this folder to avoid accidental overwrites.\")\n",
" else:\n",
Expand Down
10 changes: 5 additions & 5 deletions plash_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def deploy(
except PlashError as e: print(f"Error: {str(e)}\nInvalid path: {path}"); return

try:
if not name: name = get_app_name(path)
if not name: name = _get_app_name(path)
except FileNotFoundError:
plash_app = path / '.plash'
name = _gen_app_name()
Expand Down Expand Up @@ -190,7 +190,7 @@ def delete(
name:str=None, # Overrides the .plash file in project root if provided
force:bool=False): # Skip confirmation prompt
'Delete your deployed app'
if not name: name = get_app_name(path)
if not name: name = _get_app_name(path)
if not force:
confirm = input(f"Are you sure you want to delete app '{name}'? This action cannot be undone. [y/N]: ")
if confirm.lower() not in ['y', 'yes']:
Expand All @@ -205,15 +205,15 @@ def delete(
@call_parse
def start(path:Path=Path('.'), name:str=None):
"Start your deployed app"
if not name: name = get_app_name(path)
if not name: name = _get_app_name(path)
r = _mk_auth_req(_endpoint(rt=f"/start?name={name}"))
return r.text

# %% ../nbs/00_cli.ipynb 36
@call_parse
def stop(path:Path=Path('.'), name:str=None):
"Stop your deployed app"
if not name: name = get_app_name(path)
if not name: name = _get_app_name(path)
r = _mk_auth_req(_endpoint(rt=f"/stop?name={name}"))
return r.text

Expand Down Expand Up @@ -253,7 +253,7 @@ def download(
name:str=None, # Overrides the .plash file in project root if provided
save_path:Path=Path("./download/")): # Save path (optional)
'Download your deployed app'
if not name: name = get_app_name(path)
if not name: name = _get_app_name(path)
try: save_path.mkdir(exist_ok=False)
except: print(f"ERROR: Save path ({save_path}) already exists. Please rename or delete this folder to avoid accidental overwrites.")
else:
Expand Down
Loading