Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Expand the path so can complete paths with ~ in them #63

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 2 additions & 1 deletion typer_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
from pathlib import Path
from typing import Any, Iterable, List, Optional, Tuple, cast
import os

import click
import click.core
Expand Down Expand Up @@ -35,7 +36,7 @@ def __init__(self) -> None:
def maybe_update_state(ctx: click.Context) -> None:
path_or_module = ctx.params.get("path_or_module")
if path_or_module:
file_path = Path(path_or_module)
file_path = Path(os.path.expanduser(path_or_module))
if file_path.exists() and file_path.is_file():
state.file = file_path
else:
Expand Down