diff --git a/Scripts/add-memo.ps1 b/Scripts/add-memo.ps1 index 8e698925..02060acf 100755 --- a/Scripts/add-memo.ps1 +++ b/Scripts/add-memo.ps1 @@ -14,7 +14,7 @@ try { $User = $(whoami) $Line = "$Time,$User,$Text" - if (-not(test-path "$Path")) { + if (-not(test-path "$Path" -pathType leaf)) { write-output "Time,User,Text" > "$Path" } write-output $Line >> "$Path" diff --git a/Scripts/check-cpu-temp.ps1 b/Scripts/check-cpu-temp.ps1 index a52cce31..7781015d 100755 --- a/Scripts/check-cpu-temp.ps1 +++ b/Scripts/check-cpu-temp.ps1 @@ -6,7 +6,7 @@ #> try { - if (test-path "/sys/class/thermal/thermal_zone0/temp") { + if (test-path "/sys/class/thermal/thermal_zone0/temp" -pathType leaf) { [int]$IntTemp = get-content "/sys/class/thermal/thermal_zone0/temp" $Temp = [math]::round($IntTemp / 1000.0, 1) } else { diff --git a/Scripts/list-memos.ps1 b/Scripts/list-memos.ps1 index c0ce42e4..92fa9dfa 100755 --- a/Scripts/list-memos.ps1 +++ b/Scripts/list-memos.ps1 @@ -8,7 +8,7 @@ try { $Path = "$HOME/Memos.csv" - if (test-path "$Path") { + if (test-path "$Path" -pathType leaf) { write-progress "Reading $Path ..." $Table = import-csv "$Path" write-progress -completed "Reading $Path" diff --git a/Scripts/make-repo.ps1 b/Scripts/make-repo.ps1 index a3bb8be3..78a2959c 100755 --- a/Scripts/make-repo.ps1 +++ b/Scripts/make-repo.ps1 @@ -9,7 +9,7 @@ param($RepoDir = "$PWD") function MakeDir { param($Path) $DirName = (get-item "$Path").Name - if (test-path "$Path/CMakeLists.txt") { + if (test-path "$Path/CMakeLists.txt" -pathType leaf) { "⏳ Building 📂$DirName using CMakeLists.txt to subfolder BuildFiles..." if (-not(test-path "$Path/BuildFiles/" -pathType container)) { & mkdir "$Path/BuildFiles/" @@ -25,7 +25,7 @@ function MakeDir { param($Path) & make test if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" } - } elseif (test-path "$Path/configure") { + } elseif (test-path "$Path/configure" -pathType leaf) { "⏳ Building 📂$DirName using 'configure'..." set-location "$Path/" @@ -35,7 +35,7 @@ function MakeDir { param($Path) & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } - } elseif (test-path "$Path/autogen.sh") { + } elseif (test-path "$Path/autogen.sh" -pathType leaf) { "⏳ Building 📂$DirName using 'autogen.sh'..." set-location "$Path/" @@ -45,7 +45,7 @@ function MakeDir { param($Path) & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } - } elseif (test-path "$Path/build.gradle") { + } elseif (test-path "$Path/build.gradle" -pathType leaf) { "⏳ Building 📂$DirName using build.gradle..." set-location "$Path" @@ -55,7 +55,7 @@ function MakeDir { param($Path) & gradle test if ($lastExitCode -ne "0") { throw "'gradle test' has failed" } - } elseif (test-path "$Path/Imakefile") { + } elseif (test-path "$Path/Imakefile" -pathType leaf) { "⏳ Building 📂$DirName using Imakefile..." set-location "$RepoDir/" @@ -65,14 +65,14 @@ function MakeDir { param($Path) & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } - } elseif (test-path "$Path/Makefile") { + } elseif (test-path "$Path/Makefile" -pathType leaf) { "⏳ Building 📂$DirName using Makefile..." set-location "$Path" & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } - } elseif (test-path "$Path/compile.sh") { + } elseif (test-path "$Path/compile.sh" -pathType leaf) { "⏳ Building 📂$DirName using 'compile.sh'..." set-location "$Path/" @@ -82,7 +82,7 @@ function MakeDir { param($Path) & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } - } elseif (test-path "$Path/attower/src/build/DevBuild/build.bat") { + } elseif (test-path "$Path/attower/src/build/DevBuild/build.bat" -pathType leaf) { "⏳ Building 📂$DirName using build.bat ..." set-location "$Path/attower/src/build/DevBuild/"