Uploaded image for project: 'Community Package Repository'
  1. Community Package Repository
  2. CPR-290

Nuget package install fails if trying to create empty directory that already exists

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2017/08/02
    • Component/s: Vanagon
    • Labels:
      None
    • Template:

      Error rendering 'issue-templates-customfield'. Please contact your Jira administrators.

    • Sub-team:
    • Story Points:
      1

      Description

      I have a project creating a directory via `proj.directory 'C:/ProgramData/PuppetLabs/client-tools'`. If that directory already exists, installing the Nuget package fails with error

       New-Item : An item with the specified name C:\ProgramData\PuppetLabs\client-tools already exists.
       At C:\ProgramData\chocolatey\lib\pe-client-tools-x64\tools\chocolateyInstall.ps1:26 char:5
       +     New-Item -ItemType directory -Path "$destination"
       +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           + CategoryInfo          : ResourceExists: (C:\ProgramData\PuppetLabs\client-tools:String [New-Item], IOException
           + FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.NewItemCommand
      The install of pe-client-tools-x64 was NOT successful.
      Error while running 'C:\ProgramData\chocolatey\lib\pe-client-tools-x64\tools\chocolateyInstall.ps1'.
       See log for details.
      

      It seems that we should skip creating the directory if it already exists.

      Since uninstall leaves directories behind, this means we can't reinstall after uninstall if the package contains any empty directories.

        Attachments

          Activity

            People

            Assignee:
            michael.smith Michael Smith
            Reporter:
            michael.smith Michael Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support