Skip to content

Commit 9db68a0

Browse files
committed
tests are creating backup folder if neccessary
1 parent 6de2ce4 commit 9db68a0

File tree

7 files changed

+23
-0
lines changed

7 files changed

+23
-0
lines changed

tests/Fake-Executables/java/v1/bin/java.exe

Whitespace-only changes.

tests/Fake-Executables/java/v2/bin/java.exe

Whitespace-only changes.

tests/backups/jenv.config.bak

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"jenvs": [
3+
{
4+
"name": "jre8",
5+
"path": "C:\\Program Files\\Java\\jre1.8.0_311"
6+
},
7+
{
8+
"name": "jdk17",
9+
"path": "C:\\Program Files\\Java\\jdk-17"
10+
}
11+
],
12+
"locals": [],
13+
"global": "C:\\Program Files\\Java\\jdk-17"
14+
}

tests/backups/jenv.path.bak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:\Program Files\PowerShell\7;C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.11.3471.0_x64__8wekyb3d8bbwe;C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.11.3471.0_x64__8wekyb3d8bbwe;C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.11.3471.0_x64__8wekyb3d8bbwe;C:\Program Files\Python39\Scripts\;C:\Program Files\Python39\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\MiKTeX\miktex\bin\x64\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\libMultiMarkdown 6.6.0\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\PowerShell\7\;C:\JEnv-for-Windows

tests/backups/jenv.systemPath.bak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.11.3471.0_x64__8wekyb3d8bbwe;C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.11.3471.0_x64__8wekyb3d8bbwe;C:\Program Files\Python39\Scripts\;C:\Program Files\Python39\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\MiKTeX\miktex\bin\x64\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\libMultiMarkdown 6.6.0\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\Program Files\PowerShell\7\;

tests/backups/jenv.userPath.bak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:\JEnv-for-Windows

tests/test.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
BeforeAll {
66
Start-Transcript -Path $PSScriptRoot/test-log.txt
77
Write-Host Creating Backups
8+
9+
# Create backups folder if neccessary. Pipe to null to avoid created message
10+
if (!(test-path $PSScriptRoot/backups/)) {
11+
New-Item -ItemType Directory -Force -Path $PSScriptRoot/backups/ | Out-Null
12+
}
13+
814
Write-Host Backing up your path environment vars
915
$userPath = [System.Environment]::GetEnvironmentVariable("PATH", "User")
1016
Out-File -FilePath $PSScriptRoot/backups/jenv.userPath.bak -InputObject $userPath

0 commit comments

Comments
 (0)