Sha256: a9c5478c9e3b74b2562e1d02cfde7637b34025f36adc53036f66b5e4713c902b

Contents?: true

Size: 838 Bytes

Versions: 2

Compression:

Stored size: 838 Bytes

Contents

# frozen_string_literal: true

# tau info status arch
module InfoStatusArch
  # Backend method for info status arch.
  # @return [String] get cpu architecture
  def info_status_arch
    log.debug 'Get cpu architecture'

    architecture = _info_status_arch_get_architecture.to_sym
    # rubocop:disable Naming/VariableNumber
    architectures = { arm64: 'arm64', aarch64: 'arm64', x86_64: 'amd64' }
    # rubocop:enable Naming/VariableNumber
    unless architectures.key? architecture
      log.error 'cpu architecture unknown'
      return false
    end

    arch = architectures[architecture]
    log.debug "CPU architecture is #{arch}"
    arch
  end

  private

  # Get gopass root store
  def _info_status_arch_get_architecture
    cmd_get_arch = config.active['cmd_info_status_arch_get_arch']
    (run cmd_get_arch).chomp
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
takeltau-0.41.9 lib/takeltau/info/status/arch.rb
takeltau-0.41.0 lib/takeltau/info/status/arch.rb