From 1fdd7fb233155ffc45df404776c96242cfab0e7f Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Sat, 16 Jul 2022 23:51:21 +0900 Subject: [PATCH 1/3] Add PowerShell snippets for postinstall --- install-poetry.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/install-poetry.py b/install-poetry.py index 3b7d2b9..2857f30 100644 --- a/install-poetry.py +++ b/install-poetry.py @@ -269,7 +269,21 @@ POST_MESSAGE_CONFIGURE_FISH = """ You can execute `set -U fish_user_paths {poetry_home_bin} $fish_user_paths` """ -POST_MESSAGE_CONFIGURE_WINDOWS = """""" +POST_MESSAGE_CONFIGURE_WINDOWS = """ +You can choose and execute one of the following commands in PowerShell: + +A. Appends the bin directory to your user environment variable `PATH`: + +``` +[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";{poetry_home_bin}", "User") +``` + +B. Tries to appends the bin directory to PATH every when you run PowerShell (>=6 recommended): + +``` +echo 'if (-not (Get-Command poetry -ErrorAction Ignore)) {{ $env:Path += ";{poetry_home_bin}" }}' | Out-File -Append $PROFILE +``` +""" class PoetryInstallationError(RuntimeError): From cc3ef283e7874604ef1ef9536cc450b16ef038b9 Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Thu, 21 Nov 2024 00:00:09 +0900 Subject: [PATCH 2/3] Correcting verbs to the present tense Co-authored-by: Arun Babu Neelicattu --- install-poetry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-poetry.py b/install-poetry.py index 2857f30..722e4af 100644 --- a/install-poetry.py +++ b/install-poetry.py @@ -272,7 +272,7 @@ You can execute `set -U fish_user_paths {poetry_home_bin} $fish_user_paths` POST_MESSAGE_CONFIGURE_WINDOWS = """ You can choose and execute one of the following commands in PowerShell: -A. Appends the bin directory to your user environment variable `PATH`: +A. Append the bin directory to your user environment variable `PATH`: ``` [Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";{poetry_home_bin}", "User") From 2243411693fd41af64fb1f5db44cf1dbeba9e3fc Mon Sep 17 00:00:00 2001 From: Tatsunori Uchino Date: Thu, 21 Nov 2024 08:06:08 +0900 Subject: [PATCH 3/3] Additional fix of previous commit Co-authored-by: Arun Babu Neelicattu --- install-poetry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-poetry.py b/install-poetry.py index 722e4af..f222f0c 100644 --- a/install-poetry.py +++ b/install-poetry.py @@ -278,7 +278,7 @@ A. Append the bin directory to your user environment variable `PATH`: [Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";{poetry_home_bin}", "User") ``` -B. Tries to appends the bin directory to PATH every when you run PowerShell (>=6 recommended): +B. Try to append the bin directory to PATH every when you run PowerShell (>=6 recommended): ``` echo 'if (-not (Get-Command poetry -ErrorAction Ignore)) {{ $env:Path += ";{poetry_home_bin}" }}' | Out-File -Append $PROFILE