Skip to content

Commit

Permalink
DnnPackager.exe now writes args when fails to parse.
Browse files Browse the repository at this point in the history
  • Loading branch information
dazinator committed Dec 13, 2015
1 parent 9e7b15e commit 45b3eb0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 15 deletions.
11 changes: 9 additions & 2 deletions src/DnnPackager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ static int Main(string[] args)

if (!parsed)
{
Console.Write(options.GetUsage());
LogInfo("Could now parse arguments: ");
// write args
foreach (var item in args)
{
LogInfo(item);
}

LogInfo(options.GetUsage());
return -1;
}

Expand All @@ -51,7 +58,7 @@ static int Main(string[] args)
dnnWebsite = GetDotNetNukeWebsiteInfo(invokedVerbInstance.WebsiteName);

if (installPackages != null && installPackages.Any())
{
{
success = DeployToIISWebsite(installPackages, dnnWebsite);
}
else
Expand Down
45 changes: 32 additions & 13 deletions src/DnnPackager/tools/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,38 @@ $Project.Save()
$oldnuspecFileName = "rename.nuspecc"
$newnuspecFileName = $project.Name + ".nuspec"

function GetProjectItemIfExists
{
param (
[string]$Name
)

Try
{
$existingFile = $project.ProjectItems.Item($Name)
if($existingFile -eq $NULL)
{
return $NULL
}
else
{
return $existingFile
}
}
Catch [system.exception]
{
Write-host "DnnPackager: Exception String: $_.Exception.Message"
return $NULL;
}

}

Try
{
# is there allready a nuspec file there.
Write-host "DnnPackager: Looking for existing project nuspec file in project items named: $oldnuspecFileName"
Write-host "DnnPackager: Looking for nuspec file that needs to be renamed in project items named: $oldnuspecFileName"

$existingFile = $project.ProjectItems.Item($oldnuspecFileName)
$existingFile = GetProjectItemIfExists $oldnuspecFileName
if($existingFile -eq $NULL)
{
Write-host "Did not find $oldnuspecFileName in project."
Expand All @@ -123,28 +149,21 @@ Try
$existingFile.Remove();
Write-host "DnnPackager: Successfully removed $oldnuspecFileName now renaming underlying file."

# Rename the underlying file.

# Rename the underlying file.
$ProjectNuspecPath = $ProjectPath | Join-Path -ChildPath $oldnuspecFileName
Rename-Item $ProjectNuspecPath $newnuspecFileName
Write-host "DnnPackager: Successfully renamed file to $newnuspecFileName"

# Move-Item $ProjectNuspecPath $NewProjectNuspecPath


$NewProjectNuspecPath = $ProjectPath | Join-Path -ChildPath $newnuspecFileName
$NewProjectNuspecPath = $ProjectPath | Join-Path -ChildPath $newnuspecFileName

Write-host "DnnPackager: Adding $NewProjectNuspecPath file to project"

Write-host "DnnPackager: Adding $NewProjectNuspecPath file to project"
$newlyAddedFile = $project.ProjectItems.AddFromFile("$NewProjectNuspecPath");

Write-host "DnnPackager: Successfully added $NewProjectNuspecPath file to project."

#$newlyAddedFile.Properties.Item("SubType").Value = $sourceFile.Properties.Item("SubType").Value;
#Write-host "Successfully set subtype to $NewProjectNuspecPath file to project, now setting subtype."
#$sourceFile.Name = $newnuspecFileName


#$sourceFile.Name = $newnuspecFileName
}

}
Expand Down

2 comments on commit 45b3eb0

@dazinator
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity DnnPackager :: Continuos Build 47 is now running

@dazinator
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity DnnPackager :: Continuos Build 1.1.0-unstable.28 outcome was SUCCESS
Summary: Running Build time: 00:00:12

Please sign in to comment.