From 54ec3365f2cfb8d45cdcebb37c2322fa9fb4feb1 Mon Sep 17 00:00:00 2001 From: Richard Kuhnt Date: Wed, 31 May 2017 01:31:19 +0200 Subject: [PATCH] Don't set $env:TEMP on unix, instead use /tmp as workingdir for tests --- lib/unix.ps1 | 1 - test/Scoop-TestLib.ps1 | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/unix.ps1 b/lib/unix.ps1 index b2699a98..e38cd840 100644 --- a/lib/unix.ps1 +++ b/lib/unix.ps1 @@ -13,7 +13,6 @@ if(!(is_unix)) { $scoopdir = $env:SCOOP, (Join-Path $env:HOME "scoop") | select -first 1 $globaldir = $env:SCOOP_GLOBAL, "/usr/local/scoop" | select -first 1 $cachedir = $env:SCOOP_CACHE, (Join-Path $scoopdir "cache") | select -first 1 -$env:TEMP = "/tmp" # core.ps1 function ensure($dir) { diff --git a/test/Scoop-TestLib.ps1 b/test/Scoop-TestLib.ps1 index 1ebc02ff..e72d72e9 100644 --- a/test/Scoop-TestLib.ps1 +++ b/test/Scoop-TestLib.ps1 @@ -73,7 +73,12 @@ function setup_working($name) { } # reset working dir - $working_dir = "$env:TEMP/ScoopTestFixtures/$name" + if($PSVersionTable.Platform -eq 'Unix') { + $working_dir = "/tmp/ScoopTestFixtures/$name" + } else { + $working_dir = "$env:TEMP/ScoopTestFixtures/$name" + } + if(test-path $working_dir) { Remove-Item -Recurse -Force $working_dir }