From 3cf562e76033102904b48e4c90d70e8ce8cb32b4 Mon Sep 17 00:00:00 2001 From: Simon Parten Date: Mon, 24 Jun 2024 10:37:26 +0200 Subject: [PATCH 1/2] Create path if it does not already exist --- millw.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/millw.ps1 b/millw.ps1 index 34e9270..c747d3c 100644 --- a/millw.ps1 +++ b/millw.ps1 @@ -51,6 +51,10 @@ $MILL_USER_CACHE_DIR = Join-Path -Path $Env:LOCALAPPDATA -ChildPath 'mill' $MILL_DOWNLOAD_PATH = $Env:MILL_DOWNLOAD_PATH ?? @(Join-Path -Path ${MILL_USER_CACHE_DIR} -ChildPath 'download') +if (-not (Test-Path -Path $MILL_DOWNLOAD_PATH)) { + New-Item -Path $MILL_DOWNLOAD_PATH -ItemType Directory | Out-Null +} + if ($null -eq $MILL_VERSION) { Write-Warning -Message 'No mill version specified.' Write-Warning -Message "You should provide a version via '.mill-version' file or --mill-version option." From 2df404a0525f7182c502d8b636254e1f13a0bc0f Mon Sep 17 00:00:00 2001 From: Simon Parten Date: Tue, 25 Jun 2024 20:33:30 +0200 Subject: [PATCH 2/2] Remove whitespace --- millw.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/millw.ps1 b/millw.ps1 index c747d3c..2637ec1 100644 --- a/millw.ps1 +++ b/millw.ps1 @@ -51,8 +51,8 @@ $MILL_USER_CACHE_DIR = Join-Path -Path $Env:LOCALAPPDATA -ChildPath 'mill' $MILL_DOWNLOAD_PATH = $Env:MILL_DOWNLOAD_PATH ?? @(Join-Path -Path ${MILL_USER_CACHE_DIR} -ChildPath 'download') -if (-not (Test-Path -Path $MILL_DOWNLOAD_PATH)) { - New-Item -Path $MILL_DOWNLOAD_PATH -ItemType Directory | Out-Null +if (-not (Test-Path -Path $MILL_DOWNLOAD_PATH)) { + New-Item -Path $MILL_DOWNLOAD_PATH -ItemType Directory | Out-Null } if ($null -eq $MILL_VERSION) {