refactor(SublimeText2.app) - strictly wrapper pkg

- No more code, as the powershell subl alias and package control have
 been refactored to separate packages
This commit is contained in:
Iristyle
2013-04-04 00:06:24 -04:00
parent 656be7d066
commit 590d7a44f9
2 changed files with 12 additions and 41 deletions

View File

@@ -3,11 +3,16 @@
<metadata>
<id>SublimeText2.app</id>
<title>Sublime Text 2</title>
<version>2.0.1.2217</version>
<version>2.0.1.22171</version>
<authors>Jon Skinner</authors>
<owners>Ethan J Brown</owners>
<summary>Sublime Text 2 is a sophisticated text editor for code, html and prose. You'll love the slick user interface and extraordinary features. Includes Package Control.</summary>
<description>Sublime Text 2 is a sophisticated text editor for code, html and prose. You'll love the slick user interface and extraordinary features. Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use.
<description>Includes Sublime Text 2 AND
* Package Control
* subl alias for Powershell
Sublime Text may be downloaded and evaluated for free, however a license must be purchased for continued use.
This brings the Sublime Text full installation version to your system, which has a built-in auto-update mechanism. Furthermore, Sublime Package Control is included.</description>
<releaseNotes>Version 2.0.1
Release Date: 14 July 2012
@@ -115,5 +120,10 @@
<licenseUrl>http://www.sublimetext.com/eula</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://github.com/Iristyle/ChocolateyPackages/raw/master/SublimeText2.app/Sublime_Text.png</iconUrl>
<dependencies>
<dependency id="sublimetext2" />
<dependency id="SublimeText2.PowershellAlias" />
<dependency id="SublimeText2.PackageControl" />
</dependencies>
</metadata>
</package>

View File

@@ -1,39 +0,0 @@
try {
$package = 'SublimeText2'
#uses InnoSetup - http://unattended.sourceforge.net/InnoSetup_Switches_ExitCodes.html
Install-ChocolateyPackage 'Sublime Text 2.0.1 Setup' 'exe' '/VERYSILENT /NORESTART /TASKS="contextentry"' `
'http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20Setup.exe' `
'http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64%20Setup.exe'
# install package control
$installPath = Join-Path $Env:ProgramFiles 'Sublime Text 2'
$sublimeDataPath = Join-Path ([Environment]::GetFolderPath('ApplicationData')) 'Sublime Text 2'
$packagesPath = Join-Path $sublimeDataPath 'Installed Packages'
if (!(Test-Path $packagesPath)) { New-Item $packagesPath -Type Directory }
$packageControl = Join-Path $packagesPath 'Package Control.sublime-package'
if (!(Test-Path $packageControl))
{
# http://wbond.net/sublime_packages/package_control/installation
$packageUrl = 'http://sublime.wbond.net/Package%20Control.sublime-package'
Get-ChocolateyWebFile -url $packageUrl -fileFullPath $packageControl
}
$sublDefined = Test-Path function:subl
$profileExists = Test-Path $PROFILE
$sublInProfile = $profileExists -and (((Get-Content $PROFILE) -match '^function\s+subl\s+').Count -gt 0)
# add subl alias to powershell profile
if (!$sublDefined -and !$sublInProfile)
{
New-Item (Split-Path $PROFILE) -Type Directory -ErrorAction SilentlyContinue
'function subl { &"${Env:ProgramFiles}\Sublime Text 2\sublime_text.exe" $args }' |
Out-File -FilePath $PROFILE -Append -Encoding UTF8
Write-Host 'Added subl alias to Powershell profile to launch Sublime Text 2!'
}
Write-ChocolateySuccess $package
} catch {
Write-ChocolateyFailure $package "$($_.Exception.Message)"
throw
}