refactor(sublime pkg control): move install script
- Will need this for other packages to more safely ensure package control is setup
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
# uses functions in JsonHelpers.ps1
|
||||
function Get-SublimeInstallPath
|
||||
{
|
||||
Join-Path $Env:ProgramFiles 'Sublime Text 2'
|
||||
}
|
||||
|
||||
function Get-SublimeSettingsPath
|
||||
{
|
||||
Join-Path ([Environment]::GetFolderPath('ApplicationData')) 'Sublime Text 2'
|
||||
}
|
||||
|
||||
function Get-SublimePackagesPath
|
||||
{
|
||||
$installPath = Join-Path $Env:ProgramFiles 'Sublime Text 2'
|
||||
$settingsPath = Join-Path ([Environment]::GetFolderPath('ApplicationData')) 'Sublime Text 2'
|
||||
$packagesPath = Join-Path $settingsPath 'Packages'
|
||||
$packagesPath = Join-Path (Get-SublimeSettingsPath) 'Packages'
|
||||
if (!(Test-Path $packagesPath)) { New-Item $packagesPath -Type Directory }
|
||||
|
||||
return $packagesPath
|
||||
@@ -17,6 +24,21 @@ function Get-SublimeUserPath
|
||||
return $path
|
||||
}
|
||||
|
||||
function Install-SublimePackageControl
|
||||
{
|
||||
# install package control
|
||||
$packagesPath = Join-Path (Get-SublimeSettingsPath) '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
|
||||
}
|
||||
}
|
||||
|
||||
function Merge-PackageControlSettings
|
||||
{
|
||||
[CmdletBinding()]
|
||||
|
Reference in New Issue
Block a user