(chore ST3 package control): release 2.0.0 final

- Remove dependency on Git
 - Add dependency on JsonHelpers.ps1
 - Properly remove any previously Git installed package control
 - Install for ST3 the same way we install for ST3
This commit is contained in:
Iristyle
2014-09-15 11:36:50 -07:00
parent cb6feb525e
commit 5796a381b7
3 changed files with 31 additions and 26 deletions

View File

@@ -3,7 +3,7 @@
<metadata>
<id>SublimeText3.PackageControl</id>
<title>Sublime Text 3 Package Control</title>
<version>2.0.0.20130723</version>
<version>2.0.0.20140915</version>
<authors>Will Bond</authors>
<owners>Ethan J Brown</owners>
<summary>A full-featured package manager that helps discovering, installing, updating and removing packages for Sublime Text 3. It features an automatic upgrader and supports GitHub, BitBucket and a full channel/repository system.</summary>
@@ -20,12 +20,12 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://github.com/Iristyle/ChocolateyPackages/raw/master/SublimeText2.app/Sublime_Text.png</iconUrl>
<dependencies>
<dependency id="git" />
<dependency id="sublimetext3" />
</dependencies>
</metadata>
<files>
<file src="tools\**" target="tools" />
<file src="..\core\JsonHelpers.ps1" target="tools" />
<file src="..\core\SublimeHelpers.ps1" target="tools" />
</files>
</package>

View File

@@ -8,6 +8,7 @@ try {
$package = 'SublimeText3.PackageControl'
$current = Get-CurrentDirectory
. (Join-Path $current 'JsonHelpers.ps1')
. (Join-Path $current 'SublimeHelpers.ps1')
Install-SublimePackageControl -Version 3

View File

@@ -91,6 +91,18 @@ function Install-SublimePackagesFromCache
}
}
# clean up any previous installation attempts that were Git clnoe based
function Remove-GitInstalledSublimePackageControl
{
$installPath = 'Packages\Package Control'
$packagesPath = Join-Path (Get-SublimeSettingsPath -Version $Version) $installPath
if (Test-Path $packagesPath)
{
Write-Host "Removing previously Git installed Package Control from $packagesPath"
Remove-Item $packagesPath -Recurse -Force -ErrorAction SilentlyContinue
}
}
function Install-SublimePackageControl
{
[CmdletBinding()]
@@ -105,37 +117,29 @@ function Install-SublimePackageControl
$PreRelease = $false
)
# remove Git cloned version if it exists
if ($Version -eq 3) { Remove-GitInstalledSublimePackageControl }
# install package control
$packageFolder = if ($Version -eq 2) { 'Installed Packages' } else { 'Packages' }
$packageFolder = 'Installed Packages'
$packagesPath = Join-Path (Get-SublimeSettingsPath -Version $Version) $packageFolder
if (!(Test-Path $packagesPath)) { New-Item $packagesPath -Type Directory }
switch ($Version)
$packageControl = Join-Path $packagesPath 'Package Control.sublime-package'
if (Test-Path $packageControl) { Remove-item $packageControl }
# http://wbond.net/sublime_packages/package_control/installation
$packageUrl = 'http://sublime.wbond.net/Package%20Control.sublime-package'
if ($PreRelease)
{
2 {
$packageControl = Join-Path $packagesPath 'Package Control.sublime-package'
if (Test-Path $packageControl) { Remove-item $packageControl }
# http://wbond.net/sublime_packages/package_control/installation
$packageUrl = 'http://sublime.wbond.net/Package%20Control.sublime-package'
if ($PreRelease)
{
$packageUrl = 'https://sublime.wbond.net/prerelease/Package%20Control.sublime-package'
}
Get-ChocolateyWebFile -url $packageUrl -fileFullPath $packageControl
$settings = @{ 'install_prereleases' = $PreRelease }
Merge-PackageControlSettings -Settings $settings -Version $Version
}
3 {
Push-Location $packagesPath
git clone -b python3 https://github.com/wbond/sublime_package_control.git "Package Control"
Pop-Location
}
$packageUrl = 'https://sublime.wbond.net/prerelease/Package%20Control.sublime-package'
}
Get-ChocolateyWebFile -url $packageUrl -fileFullPath $packageControl
$settings = @{ 'install_prereleases' = $PreRelease }
Merge-PackageControlSettings -Settings $settings -Version $Version
}
function Merge-PackageControlSettings