Sitelet https://github.com/fsprojects/Paket/issues/1473
Skip to content

paket pack fails if output is underneath source directory #1473

Description

@michael-baker

If the output directory of paket pack is underneath the source directory the operation will fail with the error The process cannot access the file 'C:\Temp\pakettest\o\Foo.1.nupkg' because it is being used by another process.

Consider this PowerShell script which reproduces the issue

cd C:\Temp\pakettest

"
type file
id Foo
authors Bar
description FooPackage
version 1
files
    !*paket.*
    ** ==> lib
" | Out-File "paket.template"

"source https://www.nuget.org/api/v2" | Out-File "paket.dependencies"

$lock = "" | Out-File "paket.lock"

$somecontent = Out-File "mycontent.txt"

Invoke-Expression "cmd /c C:\Temp\pakettest\paket.exe pack templatefile paket.template output o"

To run this script create C:\Temp\pakettest and drop paket.exe into this directory.

Because "o" is located under the source directory, Paket will try and package it - which of course fails. I propose the output directory is always excluded from packaging, otherwise you need to specify !**\o\** explicitly which feels like a waste of characters or you need to ensure the output is above the source directory

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions