Sha256: b63c4cbce37de7230230cd486f2e5accd4660e3422679685c93c6baa5e388ca3

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

atom_pkg = "#{ENV['ProgramW6432']}\\Atom x64"
atom_home = "#{home}\\.atom"

[atom_pkg,
 atom_home].each do |d|
  directory d do
    action :create
  end
end

windows_zipfile ENV['ProgramW6432'] do
  source 'https://atom.io/download/windows_x64_zip'
  action :unzip
  not_if { ::File.exist?("#{atom_pkg}\\atom.exe") }
end

windows_path "#{atom_pkg}\\resources\\cli" do
  action :add
end

["#{ENV['ALLUSERSPROFILE']}\\Microsoft\\Windows\\Start Menu\\Programs\\Atom.lnk",
 "#{ENV['PUBLIC']}\\Desktop\\Atom.lnk"].each do |p|
  windows_shortcut p do
    target "#{atom_pkg}\\atom.exe"
    description 'Launch Atom Editor'
    action :create
  end
end

cookbook_file "#{atom_home}\\config.cson" do
  source 'atom.config.cson'
  action :create
end

cookbook_file "#{atom_home}\\apm-bootstrap.list" do
  source 'atom.apm.list'
  action :create
end

execute 'install Atom packages' do
  command "apm.cmd install --packages-file #{atom_home}\\apm-bootstrap.list"
  cwd "#{atom_pkg}\\resources\\app\\apm\\bin"
  environment ({ 'ATOM_HOME' => atom_home })
  action :run
  not_if { File.exist?("#{atom_home}\\packages\\language-chef\\README.md") }
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wombat-cli-0.7.3 generator_files/cookbooks/workstation/recipes/editor.rb
wombat-cli-0.7.2 generator_files/cookbooks/workstation/recipes/editor.rb
wombat-cli-0.6.2 generator_files/cookbooks/workstation/recipes/editor.rb