From 77b8eb4475aea6518d7b3e15898965a4b969e022 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Tue, 25 Aug 2015 19:43:13 +0100 Subject: [PATCH 1/2] Add install.ps1 that copies the "App_Plugins/NestedContent" folder to the project if it's been excluded from the project since original installation --- build/Install.ps1 | 18 ++++++++++++++++++ build/package.proj | 4 +++- src/Our.Umbraco.NestedContent.sln | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 build/Install.ps1 diff --git a/build/Install.ps1 b/build/Install.ps1 new file mode 100644 index 0000000..5e320c1 --- /dev/null +++ b/build/Install.ps1 @@ -0,0 +1,18 @@ +param($installPath, $toolsPath, $package, $project) + +$appPluginsFolder = $project.ProjectItems | Where-Object { $_.Name -eq "App_Plugins" } +$nestedContentFolder = $appPluginsFolder.ProjectItems | Where-Object { $_.Name -eq "NestedContent" } + +$newPackageFiles = "$installPath\Content\App_Plugins\NestedContent" + +$projFile = Get-Item ($project.FullName) +$projDirectory = $projFile.DirectoryName +$projectPath = Join-Path $projDirectory -ChildPath "App_Plugins" +$projectPathExists = Test-Path $projectPath + +if ($projectPathExists -and !$nestedContentFolder) { + Write-Host "Updating Nested Content App_Plugin files using PS as they have been excluded from the project" + Copy-Item $newPackageFiles $projectPath -Recurse -Force +} + + diff --git a/build/package.proj b/build/package.proj index 747d160..cd53a5d 100644 --- a/build/package.proj +++ b/build/package.proj @@ -123,6 +123,7 @@ + @@ -132,7 +133,8 @@ - + + diff --git a/src/Our.Umbraco.NestedContent.sln b/src/Our.Umbraco.NestedContent.sln index 9362de1..b00a091 100644 --- a/src/Our.Umbraco.NestedContent.sln +++ b/src/Our.Umbraco.NestedContent.sln @@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Package", "Build Pack ..\appveyor.yml = ..\appveyor.yml ..\build-appveyor.cmd = ..\build-appveyor.cmd ..\build.cmd = ..\build.cmd + ..\build\install.ps1 = ..\build\install.ps1 ..\build\package.nuspec = ..\build\package.nuspec ..\build\package.proj = ..\build\package.proj ..\build\package.xml = ..\build\package.xml From 6ea4b22ebe176a0f9afaff747d824cc682f8f960 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Wed, 26 Aug 2015 09:56:47 +0100 Subject: [PATCH 2/2] Fix so that Install.ps1 doesn't do anything for website projects --- build/Install.ps1 | 21 +++++++++++++-------- src/Our.Umbraco.NestedContent.sln | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/build/Install.ps1 b/build/Install.ps1 index 5e320c1..03a3225 100644 --- a/build/Install.ps1 +++ b/build/Install.ps1 @@ -3,16 +3,21 @@ param($installPath, $toolsPath, $package, $project) $appPluginsFolder = $project.ProjectItems | Where-Object { $_.Name -eq "App_Plugins" } $nestedContentFolder = $appPluginsFolder.ProjectItems | Where-Object { $_.Name -eq "NestedContent" } -$newPackageFiles = "$installPath\Content\App_Plugins\NestedContent" +if (!$nestedContentFolder) +{ + $newPackageFiles = "$installPath\Content\App_Plugins\NestedContent" -$projFile = Get-Item ($project.FullName) -$projDirectory = $projFile.DirectoryName -$projectPath = Join-Path $projDirectory -ChildPath "App_Plugins" -$projectPathExists = Test-Path $projectPath + $projFile = Get-Item ($project.FullName) + $projDirectory = $projFile.DirectoryName + $projectPath = Join-Path $projDirectory -ChildPath "App_Plugins" + $projectPathExists = Test-Path $projectPath -if ($projectPathExists -and !$nestedContentFolder) { - Write-Host "Updating Nested Content App_Plugin files using PS as they have been excluded from the project" - Copy-Item $newPackageFiles $projectPath -Recurse -Force + if ($projectPathExists) { + Write-Host "Updating Nested Content App_Plugin files using PS as they have been excluded from the project" + Copy-Item $newPackageFiles $projectPath -Recurse -Force + } } + + diff --git a/src/Our.Umbraco.NestedContent.sln b/src/Our.Umbraco.NestedContent.sln index b00a091..d5f896a 100644 --- a/src/Our.Umbraco.NestedContent.sln +++ b/src/Our.Umbraco.NestedContent.sln @@ -16,7 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Package", "Build Pack ..\appveyor.yml = ..\appveyor.yml ..\build-appveyor.cmd = ..\build-appveyor.cmd ..\build.cmd = ..\build.cmd - ..\build\install.ps1 = ..\build\install.ps1 + ..\build\Install.ps1 = ..\build\Install.ps1 ..\build\package.nuspec = ..\build\package.nuspec ..\build\package.proj = ..\build\package.proj ..\build\package.xml = ..\build\package.xml