Sha256: 1032ee64a4a604ce953f04e69abac328c0c987d7145c3a25861a2906c573262a

Contents?: true

Size: 618 Bytes

Versions: 4

Compression:

Stored size: 618 Bytes

Contents

module Getch
  module FileSystem
    module Ext4
      class Format < Getch::FileSystem::Ext4::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("mkswap -f #{@dev_swap}")
          exec("mkfs.ext4 -F #{@dev_root}")
          exec("mkfs.ext4 -F #{@dev_home}") if @dev_home
          @state.format
        end

        private

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
getch-0.1.5 lib/getch/filesystem/ext4/format.rb
getch-0.1.3 lib/getch/filesystem/ext4/format.rb
getch-0.1.2 lib/getch/filesystem/ext4/format.rb
getch-0.1.1 lib/getch/filesystem/ext4/format.rb