System.Data.SQLite
Check-in [007720e8f0]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Verify the folder path exists prior to calling the PowerShell Get-ChildItem cmdlet on it during uninstall.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nugetChanges
Files: files | file ages | folders
SHA1: 007720e8f0ecd5810b68b0f5c810c40ab11f5294
User & Date: mistachkin 2014-08-19 04:34:11
Context
2014-08-19
05:08
Add some comments. check-in: 5e0ecd4053 user: mistachkin tags: nugetChanges
04:34
Verify the folder path exists prior to calling the PowerShell Get-ChildItem cmdlet on it during uninstall. check-in: 007720e8f0 user: mistachkin tags: nugetChanges
02:12
Fix typo in comment. check-in: 7879082337 user: mistachkin tags: nugetChanges
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to NuGet/net20/Core/uninstall.ps1.

    37     37     #
    38     38     # NOTE: Great care is needed here.  If the folder contains items other
    39     39     #       than the items this script is responsible for, it must be left
    40     40     #       alone.  Furthermore, the directory (on the file system) should
    41     41     #       be deleted if it ends up empty due to this script.
    42     42     #
    43     43     if ($folder.ProjectItems.Count -eq 0) {
    44         -    $folderItems = Get-ChildItem -Path $folder.FileNames(1) -Recurse
           44  +    $folderPath = $folder.FileNames(1)
           45  +
           46  +    if (Test-Path $folderPath) {
           47  +      $folderItems = Get-ChildItem -Path $folderPath -Recurse
    45     48   
    46         -    if ($folderItems -eq $null) {
    47         -      $folder.Delete()
    48         -    } else {
    49         -      $folder.Remove()
           49  +      if ($folderItems -eq $null) {
           50  +        $folder.Delete()
           51  +      } else {
           52  +        $folder.Remove()
           53  +      }
    50     54       }
    51     55     }
    52     56   }

Changes to NuGet/net40/Core/uninstall.ps1.

    37     37     #
    38     38     # NOTE: Great care is needed here.  If the folder contains items other
    39     39     #       than the items this script is responsible for, it must be left
    40     40     #       alone.  Furthermore, the directory (on the file system) should
    41     41     #       be deleted if it ends up empty due to this script.
    42     42     #
    43     43     if ($folder.ProjectItems.Count -eq 0) {
    44         -    $folderItems = Get-ChildItem -Path $folder.FileNames(1) -Recurse
           44  +    $folderPath = $folder.FileNames(1)
           45  +
           46  +    if (Test-Path $folderPath) {
           47  +      $folderItems = Get-ChildItem -Path $folderPath -Recurse
    45     48   
    46         -    if ($folderItems -eq $null) {
    47         -      $folder.Delete()
    48         -    } else {
    49         -      $folder.Remove()
           49  +      if ($folderItems -eq $null) {
           50  +        $folder.Delete()
           51  +      } else {
           52  +        $folder.Remove()
           53  +      }
    50     54       }
    51     55     }
    52     56   }