<commit_before>emacs = node.emacs
home = emacs.config_dir || File.expand_path("~/.") + "/.emacs.d"

git "#{home}" do
  action :sync
  repository "https://github.com/katsyoshi/dot.emacs.d"
  not_if "test -d #{home}"
end

emacs.font&.tap do |font|
  template "#{home}/settings/font.el" do
    action :create
    source "templates/dot.emacs.d/settings/font.el.erb"
    variables(family: font.family, height: font.height, os: node.platform)
  end
end

emacs.packages&.tap do |packages|
  template "#{home}/settings/package.el" do
    action :create
    source "templates/dot.emacs.d/settings/package.el.erb"
    variables(packages: packages)
  end
end

emacs.settings&.tap do |settings|
  template "#{home}/init.el" do
    action :create
    source "templates/dot.emacs.d/init.el.erb"
    variables(home: home, packages: settings)
  end
end<commit_msg>set user permission<commit_after>emacs = node.emacs
home = emacs.config_dir || File.expand_path("~/.") + "/.emacs.d"

git "#{home}" do
  action :sync
  repository "https://github.com/katsyoshi/dot.emacs.d"
  not_if "test -d #{home}"
end

emacs.font&.tap do |font|
  template "#{home}/settings/font.el" do
    action :create
    source "templates/dot.emacs.d/settings/font.el.erb"
    variables(family: font.family, height: font.height, os: node.platform)
  end
end

emacs.packages&.tap do |packages|
  template "#{home}/settings/package.el" do
    action :create
    source "templates/dot.emacs.d/settings/package.el.erb"
    variables(packages: packages)
  end
end

emacs.settings&.tap do |settings|
  template "#{home}/init.el" do
    action :create
    source "templates/dot.emacs.d/init.el.erb"
    variables(home: home, packages: settings)
  end
end

emacs.user&.tap do |user|
  execute "change owner of #{user}" do
    command "chown -R #{user.name}:#{user.group} #{home}"
  end
end
{'fraction_non_alphanumeric': 0.15522875816993464, 'fraction_numerical': 0.0, 'mean_word_length': 3.6743002544529264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4978571', 'n_tokens_mistral': 672, 'n_tokens_neox': 663, 'n_words': 149}