Sha256: 463ec332691d2db89cf4c59bca84bbf1593ce28ad3d2b90499decc0f201332e1

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

module Getch
  module FileSystem
    module Ext4
      module Encrypt
        class Format < Getch::FileSystem::Ext4::Encrypt::Device
          def initialize
            super
            @state = Getch::States.new
            format
          end

          def format
            return if STATES[:format]

            exec("mkfs.fat -F32 #{@dev_esp}") if @dev_esp
            exec("mkfs.ext4 -F #{@luks_root}")
            exec("mkfs.ext4 -F #{@luks_home}") if @dev_home
            @state.format
          end

          private

          def exec(cmd)
            Getch::Command.new(cmd).run!
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
getch-0.1.9 lib/getch/filesystem/ext4/encrypt/format.rb