Skip to content

Commit

Permalink
feat: Check for LongPaths setting (#3387)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash258 authored and r15ch13 committed Apr 26, 2019
1 parent 72730e0 commit 1a6fd6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/diagnostic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,16 @@ function check_main_bucket {

return $true
}

function check_long_paths {
$key = Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -ErrorAction SilentlyContinue -Name 'LongPathsEnabled'
if (!$key -or ($key.LongPathsEnabled -eq 0)) {
warn 'LongPaths support is not enabled.'
Write-Host "You can enable it with running:"
Write-Host " Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1"

return $false
}

return $true
}
1 change: 1 addition & 0 deletions libexec/scoop-checkup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ $issues = 0
$issues += !(check_windows_defender $false)
$issues += !(check_windows_defender $true)
$issues += !(check_main_bucket)
$issues += !(check_long_paths)

$globaldir = New-Object System.IO.DriveInfo($globaldir)
if($globaldir.DriveFormat -ne 'NTFS') {
Expand Down

0 comments on commit 1a6fd6e

Please sign in to comment.