Skip to content

Commit

Permalink
Cross platform profile path
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankpatibandla committed Apr 11, 2024
1 parent 0ae05b3 commit 11fa5c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pros/cli/misc_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def setup_autocomplete(shell, config_file):

if shell in ('pwsh', 'powershell') and config_file is None:
try:
default_config_files[shell] = subprocess.run(f'{shell} -c "echo $profile"', capture_output=True, check=True).stdout.decode().strip()
profile_command = f'{shell} -c "echo $profile"' if os.name == 'nt' else f"{shell} -c 'echo $PROFILE'"
default_config_files[shell] = subprocess.run(profile_command, capture_output=True, check=True).stdout.decode().strip()
except subprocess.CalledProcessError as exc:
raise click.UsageError("Failed to determine the PowerShell profile path. Please specify a valid config file.") from exc

Expand Down

0 comments on commit 11fa5c1

Please sign in to comment.