Sha256: c9819ce7ecb0d9104129a0d1d9845f646a154f821531d450f985b1dff33cbcb5

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

require 'complex_config/shortcuts'
require 'tins/xt/secure_write'
require 'fileutils'

module Hackmac
  module Config
    extend FileUtils
    extend ComplexConfig::Provider::Shortcuts

    DEFAULT = <<~end
      ---
      devices:
        boot:
          name: EFI
        #backup:
        #  name: BACKUP_EFI
      github:
        user: null
        access_token: null
      kext:
        efi_path: EFI/CLOVER/kexts/Other
        sources:
          AppleALC:
            github: 'acidanthera/AppleALC'
          IntelMausi:
            github: 'acidanthera/IntelMausi'
          Lilu:
            github: 'acidanthera/Lilu'
          USBInjectAll:
            github: 'Sniki/OS-X-USB-Inject-All'
          VirtualSMC:
            github: 'acidanthera/VirtualSMC'
          WhateverGreen:
            github: 'acidanthera/WhateverGreen'

    end

    def self.load
      path = File.expand_path('~/config')
      mkdir_p path
      ComplexConfig::Provider.config_dir = path
      config_path = File.join(path, 'hackmac.yml')
      unless File.exist?(config_path)
        File.secure_write(config_path, DEFAULT)
      end
      complex_config.hackmac
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hackmac-0.2.1 lib/hackmac/config.rb
hackmac-0.2.0 lib/hackmac/config.rb
hackmac-0.1.1 lib/hackmac/config.rb
hackmac-0.1.0 lib/hackmac/config.rb