From 257c2c3d82927506863c6ad6721c3a041b522c57 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 23 Apr 2025 12:32:13 +0200 Subject: [PATCH] Updated cd-downloads.ps1 --- scripts/cd-downloads.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/cd-downloads.ps1 b/scripts/cd-downloads.ps1 index a3a44f76..bb7839d4 100755 --- a/scripts/cd-downloads.ps1 +++ b/scripts/cd-downloads.ps1 @@ -13,13 +13,16 @@ #> try { - if ($IsLinux) { + if ($IsLinux -or $IsMacOS) { + if (-not(Test-Path "~/Downloads" -pathType container)) { + throw "No downloads folder at ~/Downloads yet" + } $path = Resolve-Path "~/Downloads" } else { $path = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path - } - if (-not(Test-Path "$path" -pathType container)) { - throw "No downloads folder at 📂$path" + if (-not(Test-Path "$path" -pathType container)) { + throw "No downloads folder at 📂$path" + } } Set-Location "$path" $files = Get-ChildItem $path -attributes !Directory