Skip to content

Instantly share code, notes, and snippets.

@mriddle
Last active December 15, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mriddle/5185266 to your computer and use it in GitHub Desktop.
Save mriddle/5185266 to your computer and use it in GitHub Desktop.
Ability to add custom packages from within the Sublime Text 2 Puppet Module
# Install Sublime Text 2 into /Applications
#
# Usage:
#
# include sublime_text_2
class sublime_text_2 {
package { 'SublimeText2':
provider => 'appdmg',
source => 'http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1.dmg';
}
$base = "/Users/${::luser}/Library/Application Support"
$structure = [ "${base}/Sublime Text 2", "${base}/Sublime Text 2/Packages" ]
file { $structure:
ensure => 'directory',
owner => "${::luser}",
mode => '0755',
}
file { "${boxen::config::bindir}/subl":
ensure => link,
target => '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
mode => '0755',
require => Package['SublimeText2'],
}
define addpkg {
$packagedir = "/Library/Application Support/Sublime Text 2/Packages/"
$pkgarray = split($name, '[/]')
$pkgname = $pkgarray[1]
exec { "git clone https://github.com/${name}.git":
cwd => "/Users/${::luser}${packagedir}",
provider => 'shell',
creates => "/Users/${::luser}${packagedir}${pkgname}",
path => "${boxen::config::homebrewdir}/bin",
require => [Package['SublimeText2'], Class['git']],
}
}
addpkg { [
"jisaacks/GitGutter",
"surjikal/sublime-coffee-compile",
"jashkenas/coffee-script-tmbundle",
"revolunet/sublimetext-markdown-preview",
"SublimeColors/Solarized",
]:
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment