Skip to content

Commit

Permalink
Removed mkdir from module
Browse files Browse the repository at this point in the history
mkdir does not work as expected on linux
  • Loading branch information
lipkau committed May 4, 2018
1 parent 0f9f053 commit b6c4570
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Examples/Install-PSDepend.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ if(-not ($NugetPath = (Get-Command 'nuget.exe' -ErrorAction SilentlyContinue).Pa
}

# Bootstrap PSDepend, re-use nuget.exe for the module
if($path) { $null = mkdir $path -Force }
if($path) { $null = New-Item $path -ItemType Directory -Force }
$NugetParams = 'install', 'PSDepend', '-Source', 'https://www.powershellgallery.com/api/v2/',
'-ExcludeVersion', '-NonInteractive', '-OutputDirectory', $Path
& $NugetPath @NugetParams
Move-Item -Path $NugetPath -Destination "$(Join-Path $Path PSDepend)\nuget.exe" -Force
Move-Item -Path $NugetPath -Destination "$(Join-Path $Path PSDepend)\nuget.exe" -Force
4 changes: 2 additions & 2 deletions Examples/ModuleDependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Set-Content C:\MyModule\Requirements.psd1 -Value @'
DependencyType = 'Command'
Source = '$DepFolder = "$DependencyFolder\Dependencies"',
'if(-not (Test-Path $DepFolder\AzCopy\AzCopy.exe)){
$null = mkdir $DepFolder\AzCopy -Force;
$null = New-Item $DepFolder\AzCopy -ItemType Directory -Force;
Start-Process msiexec -ArgumentList "/a $DepFolder\azcopy.msi /qb TARGETDIR=$DepFolder\AzTemp /quiet" -Wait;
Copy-Item "$DepFolder\AzTemp\Microsoft SDKs\Azure\AzCopy\*" $DepFolder\AzCopy -Force;
Remove-Item $DepFolder\AZTemp -Recurse -Force;
Expand Down Expand Up @@ -138,4 +138,4 @@ So! If you need a re-usable, functional, self-documenting way to pull in module

Huge thanks to Mike Walker for the idea : )

Cheers!
Cheers!
4 changes: 2 additions & 2 deletions PSDepend/PSDependScripts/Git.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ $GottaInstall = $True
if(-not (Test-Path $Target) -and $PSDependAction -contains 'Install')
{
Write-Verbose "Creating folder [$Target] for git dependency [$Name]"
$null = mkdir $Target -Force
$null = New-Item $Target -ItemType Directory -Force
}

if(-not (Test-Path $RepoPath))
Expand Down Expand Up @@ -222,4 +222,4 @@ if($ImportPath)
{
$ToImport = $ImportPath
}
Import-PSDependModule $ToImport
Import-PSDependModule $ToImport
4 changes: 2 additions & 2 deletions PSDepend/Private/Bootstrap-Nuget.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function BootStrap-Nuget {
if(-not (Test-Path $Parent))
{
Write-Verbose "Creating parent paths to [$NugetPath]'s parent: [$Parent]"
mkdir $Parent -Force
$null = New-Item $Parent -ItemType Directory -Force
}
Write-Verbose "Downloading nuget to [$NugetPath]"
Invoke-WebRequest -uri 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile $NugetPath
Expand All @@ -29,4 +29,4 @@ function BootStrap-Nuget {
{
$ENV:Path = $ENV:Path, $Parent -join ';'
}
}
}

0 comments on commit b6c4570

Please sign in to comment.