diff --git a/composeApp/src/jvmMain/kotlin/io/github/hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt b/composeApp/src/jvmMain/kotlin/io/github/hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt index 82c9391..1107027 100644 --- a/composeApp/src/jvmMain/kotlin/io/github/hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt +++ b/composeApp/src/jvmMain/kotlin/io/github/hayatoyagi/prvisualizer/github/session/GitHubTokenStore.kt @@ -109,7 +109,7 @@ object GitHubTokenStore { val path = windowsTokenFilePath() val script = """ - |if (!(Test-Path ${'$'}env:$WINDOWS_TOKEN_ENV_PATH)) { exit 1 } + |if ([string]::IsNullOrWhiteSpace(${'$'}env:$WINDOWS_TOKEN_ENV_PATH)) { exit 1 } |${'$'}dir = [IO.Path]::GetDirectoryName(${'$'}env:$WINDOWS_TOKEN_ENV_PATH) |if (!(Test-Path ${'$'}dir)) { New-Item -Path ${'$'}dir -ItemType Directory | Out-Null } |${'$'}secure = ConvertTo-SecureString -String ${'$'}env:$WINDOWS_TOKEN_ENV_VALUE -AsPlainText -Force