Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 25d99f2

Browse files
author
Jérémie Bertrand
committed
Fix #318
1 parent b7afc2c commit 25d99f2

7 files changed

Lines changed: 11 additions & 79 deletions

File tree

BuildScripts/AppVeyor-Build.ps1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,24 @@ function CreatePackage($versionInfos)
9595

9696
Copy-Item $tools\chocolatey\Pretzel\pretzel.nuspec chocoTemp\Pretzel\pretzel.nuspec
9797
Copy-Item $tools\chocolatey\Pretzel\chocolateyInstall.ps1 chocoTemp\Pretzel\tools\chocolateyInstall.ps1
98-
Copy-Item $tools\chocolatey\Pretzel\chocolateyUninstall.ps1 chocoTemp\Pretzel\tools\chocolateyUninstall.ps1
99-
Copy-Item $tools\chocolatey\Pretzel\chocolateyBeforeModify.ps1 chocoTemp\Pretzel\tools\chocolateyBeforeModify.ps1
10098

10199
ReplaceChocoInstInfos chocoTemp\Pretzel\tools\chocolateyInstall.ps1 $version $tag $artifacts\Pretzel.$version.zip
102100

103101
nuget pack chocoTemp\Pretzel\pretzel.nuspec -OutputDirectory $artifacts -Version $version -NoPackageAnalysis
104102

105103
# create Pretzel.ScriptCs zip
106-
get-childitem $src\Pretzel.ScriptCs\bin\Release -filter *.dll | % { $_.Name } | out-file $artifacts\Pretzel.ScriptCs.Files.txt
107-
108104
RemoveIfExists Pretzel.ScriptCs.$version.zip
109105
7z a $artifacts\Pretzel.ScriptCs.$version.zip $src\Pretzel.ScriptCs\bin\Release\*.dll
110-
7z a $artifacts\Pretzel.ScriptCs.$version.zip $artifacts\Pretzel.ScriptCs.Files.txt
111106

112107
# build Pretzel.ScriptCs nupkg
108+
113109
mkdir chocoTemp\Pretzel.ScriptCs\tools
114110
Copy-Item $tools\chocolatey\Pretzel.ScriptCs\pretzel.scriptcs.nuspec chocoTemp\Pretzel.ScriptCs\pretzel.scriptcs.nuspec
115111
Copy-Item $tools\chocolatey\Pretzel.ScriptCs\chocolateyInstall.ps1 chocoTemp\Pretzel.ScriptCs\tools\chocolateyInstall.ps1
116112
Copy-Item $tools\chocolatey\Pretzel.ScriptCs\chocolateyUninstall.ps1 chocoTemp\Pretzel.ScriptCs\tools\chocolateyUninstall.ps1
113+
117114
ReplaceChocoInstInfos chocoTemp\Pretzel.ScriptCs\tools\chocolateyInstall.ps1 $version $tag $artifacts\Pretzel.ScriptCs.$version.zip
115+
ReplaceChocoInstInfos chocoTemp\Pretzel.ScriptCs\tools\chocolateyUninstall.ps1 $version $tag $artifacts\Pretzel.ScriptCs.$version.zip
118116

119117
nuget pack chocoTemp\Pretzel.ScriptCs\pretzel.scriptcs.nuspec -OutputDirectory $artifacts -Version $version -NoPackageAnalysis
120118

BuildScripts/build.proj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@
7676
<FileUpdate Files="$(ChocolateyInstall)"
7777
Regex="{{version}}"
7878
ReplacementText="$(Version)"/>
79-
<Copy SourceFiles="$(MSBuildProjectDirectory)\..\tools\chocolatey\Pretzel\chocolateyUninstall.ps1"
80-
DestinationFiles="$(MSBuildProjectDirectory)\..\build\chocolatey\tools\chocolateyUninstall.ps1" />
8179

8280
<Exec Command='"@(NuGet)" pack "$(MSBuildProjectDirectory)\..\build\chocolatey\pretzel.nuspec" -OutputDirectory "$(MSBuildProjectDirectory)\..\artifacts" -Version $(Version) -NoPackageAnalysis' />
8381
<Message Text="=========== Package Done ===========" Importance="High" />
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$packageName = 'Pretzel.ScriptCs'
22
$url = 'https://github.com/Code52/Pretzel/releases/download/{{tag}}/Pretzel.ScriptCs.{{version}}.zip'
33

4-
$binRoot = Get-BinRoot
5-
$pretzelPath = "$binRoot\Pretzel"
4+
# It is a plugin to Pretzel and as such need to be installed in the same directory
5+
$installDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)\..\..\pretzel\tools"
66

7-
Install-ChocolateyZipPackage "$packageName" "$url" $pretzelPath -checksum {{checksum}} -checksumType sha256
7+
Install-ChocolateyZipPackage $packageName $url $installDir -checksum {{checksum}} -checksumType sha256
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
Write-Debug "Uninstall Pretzel.ScriptCs"
22

3-
$binRoot = Get-BinRoot
4-
$pretzelPath = "$binRoot\Pretzel"
3+
$installDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
4+
$pretzelPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)\..\..\pretzel\tools"
55

66
# Remove folder
77
If (Test-Path $pretzelPath){
8-
gc $pretzelPath\Pretzel.ScriptCs.Files.txt | foreach ($_) { If (($_) -And (Test-Path $pretzelPath\$_)) { Remove-Item $pretzelPath\$_ } }
9-
Remove-Item $pretzelPath\Pretzel.ScriptCs.Files.txt
8+
gc $installDir\..\Pretzel.ScriptCs.{{version}}.zip.txt | foreach ($_) { If (($_) -And (Test-Path $_)) { Remove-Item $_ } }
109
}

tools/chocolatey/Pretzel/chocolateyBeforeModify.ps1

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
$packageName = 'Pretzel'
22
$url = 'https://github.com/Code52/Pretzel/releases/download/{{tag}}/Pretzel.{{version}}.zip'
3+
$installDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
34

4-
$binRoot = Get-BinRoot
5-
$pretzelPath = "$binRoot\$packageName"
6-
7-
Install-ChocolateyZipPackage "$packageName" "$url" $pretzelPath -checksum {{checksum}} -checksumType sha256
8-
Install-ChocolateyPath $pretzelPath
5+
Install-ChocolateyZipPackage $packageName $url $installDir -checksum {{checksum}} -checksumType sha256

tools/chocolatey/Pretzel/chocolateyUninstall.ps1

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)