Sha256: 1374112bbe6c9b6cc407bfb450145fca5267bb7db27f544c13cfde901a9dec4e
Contents?: true
Size: 1.13 KB
Versions: 6
Compression:
Stored size: 1.13 KB
Contents
# frozen_string_literal: true require 'rake' module KubsCLI # Copies from a repo to $HOME directory class Copy attr_accessor :config def initialize(config = KubsCLI.configuration) @fh = FileHelper.new @config = config end def copy_all copy_dotfiles copy_gnome_terminal_settings end def copy_dotfiles Dir.each_child(@config.dotfiles) do |file| config_file = File.join(@config.dotfiles, file) local_file = File.join(@config.local_dir, ".#{file}") @fh.copy(from: config_file, to: local_file) end end def copy_gnome_terminal_settings # This is the ONLY spot for gnome terminal gnome_path = '/org/gnome/terminal/' gnome_file = @config.gnome_terminal_settings unless File.exist?(gnome_file) KubsCLI.add_error(e: KubsCLI::Error, msg: "Could not find #{gnome_file}") return end dconf_load = "dconf load #{gnome_path} < #{config.misc_files}/gnome_terminal_settings" Rake.sh(dconf_load) rescue RuntimeError => e KubsCLI.add_error(e: e, msg: 'Unable to copy gnome settings') end end end
Version data entries
6 entries across 6 versions & 1 rubygems