Skip to content

Commit 69ed4e4

Browse files
committed
jenv.conf is now in C:\Users\felix\AppData\Roaming
1 parent 1697ae4 commit 69ed4e4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

jenv.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#Requires -Version 5.0
22

3-
$jenvConfig = $PSScriptRoot + "\jenv.config"
4-
$jenvConfigTmp = $PSScriptRoot + "\jenv.config.tmp"
3+
# The location for the config file
4+
If(!(test-path $Env:APPDATA\JEnv\))
5+
{
6+
New-Item -ItemType Directory -Force -Path $Env:APPDATA\JEnv\
7+
}
8+
$jenvConfig = $Env:APPDATA + "\JEnv\jenv.config"
9+
$jenvConfigTmp = $Env:APPDATA + "\JEnv\jenv.config.tmp"
10+
511

612
function Invoke-Help {
713

@@ -156,7 +162,7 @@ function Invoke-Remove {
156162
# Load config file
157163
if (!(Test-Path $jenvConfig)) {
158164
#create config if not exist
159-
New-Item -path $jenvConfig -type "file"
165+
New-Item -path $jenvConfig -type "file" | Out-Null
160166
}
161167
Get-Content $jenvConfig | foreach-object -begin { $config = @{} } -process { $k = [regex]::split($_, '='); if (($k[0].CompareTo("") -ne 0) -and ($k[0].StartsWith("[") -ne $True)) { $config.Add($k[0], $k[1]) } }
162168

0 commit comments

Comments
 (0)