Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the temp directory to be overridden #31

Closed
sayedihashimi opened this issue Dec 21, 2012 · 9 comments
Closed

Allow the temp directory to be overridden #31

sayedihashimi opened this issue Dec 21, 2012 · 9 comments
Assignees
Labels
Milestone

Comments

@sayedihashimi
Copy link
Owner

In some cases it would be useful to allow the temp directory to be overridden. Currently it just used the %temp% directory.

@ghost ghost assigned sayedihashimi Dec 21, 2012
@sayedihashimi
Copy link
Owner Author

Resolved by commit c0e4107.

Usage

To override the temp directory in the same PowerShell window that you will execute publish-interactive.ps1 declare the following.
$pkgWebOptions["tempFolder"]="C:\Temp\publish\temp"

If you are using PublishConfiguration.ps1 you can set this value in that file as well.

Files

Until the fix is released the .nupkg file is at https://dl.dropbox.com/u/40134810/PackageWeb/PackageWeb.1.1.7.nupkg

The new version of publish-interactive.ps1 is available at https://raw.github.com/sayedihashimi/package-web/c0e4107479de2885aabf4ed8ccceb4cc31ebaea9/Powershell/Publish-Interactive.ps1

@tbehunin
Copy link

I can't seem to get this to work as expected. I added the following to the PublishConfiguration.ps1 (along with the other $settingsFromUser parameters):

$pkgWebOptions =@()
$pkgWebOptions += @{name="tempFolder";value="C:\Temp\Publish"}

When the code executes, I get the following output:

PS C:\dev\Learning.com\Platform_Trunk\src\EasyTech\Platform Web\obj\Dev\Package> .\Publish-Interactive.ps1
Detected parameters file, you will not be prompted for parameters. File= [C:\dev\Learning.com\Platform_Trunk\src\EasyTech\Platform Web\obj\Dev\Package\PublishConfiguration.ps1]
Zip file for publishing: [Learning.Com.Web.zip]
Using temp foler [C:\Users\tbehunin\AppData\Local\Temp]
Temp folder [C:\Users\tbehunin\AppData\Local\Temp\Learning.Com.Web_zip]
Deleting temp folder [C:\Users\tbehunin\AppData\Local\Temp\Learning.Com.Web_zip]
Creating temp directory [C:\Users\tbehunin\AppData\Local\Temp\Learning.Com.Web_zip]

As you can see, it still uses the value from $env:Temp (line 671 in Publish-Interactive.ps1). For some reason, $pkgWebOptions is null when the following code on line 673 is evaluated:

if($pkgWebOptions -and $pkgWebOptions["tempFolder"]){

@sayedihashimi
Copy link
Owner Author

I've got a bug here, thanks for letting me know. The fix is straight forward but I don't have the time at this minute to make it.

In the mean time in the publishconfiguration.ps1 you can declare the temp folder in the following manner.

$global:pkgWebOptions =@{}
$global:pkgWebOptions["tempFolder"]="C:\temp\publish\01\a"

@sayedihashimi
Copy link
Owner Author

I have fixed this. You can now override the temp folder used by adding the following PublishConfiguration.ps1

$global:pkgWebOptions =@{}
$global:pkgWebOptions["tempFolder"]="C:\temp\publish\01\a"

You can find a drop for testing at https://dl.dropbox.com/u/40134810/PackageWeb/issue-31/PackageWeb.zip. Please re-open if you still have issues.

@tbehunin
Copy link

Nice! Thanks!

@sayedihashimi
Copy link
Owner Author

U have a preference as to which bug I work on next?

@tbehunin
Copy link

Definitely #48. We can't get PackageWeb to work at all in our automated CI environment. Works fine though when executing it manually.

@sayedihashimi
Copy link
Owner Author

OK cool, I'll look into that one next. I'm already about half way through #42 so will finish that one first, then move on to your issue. That one may take some time, I get the feeling it won't be an easy fix :(

@sayedihashimi
Copy link
Owner Author

Sorry couldn't get to #48 today, but I did also resolve #42 today. Got to run and have to work on my book for the next few days. Let me know if you have any issues with the fixed. #48 will be next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants