paket pack fails if output is underneath source directory #1473

Closed
michael-baker opened this Issue Feb 14, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@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

forki added a commit that referenced this issue Feb 14, 2016

@forki forki closed this in d1771c4 Feb 14, 2016

@forki forki added the bug label Feb 14, 2016

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