Sha256: 8a094424f3dec3ed925ddbf5fffe1c94698073506c3c68cc87c123ebcd907285

Contents?: true

Size: 700 Bytes

Versions: 3

Compression:

Stored size: 700 Bytes

Contents

module Getch
  module FileSystem
    module Ext4
      class Format < Getch::FileSystem::Ext4::Device
        def initialize
          super
          @fs = 'ext4'
          @state = Getch::States.new()
          format
        end

        def format
          return if STATES[:format]
          puts "Format #{@disk} with #{@fs}"
          exec("mkfs.fat -F32 #{@dev_boot_efi}") if Helpers::efi?
          exec("mkswap -f #{@dev_swap}")
          exec("mkfs.#{@fs} -F #{@dev_root}")
          exec("mkfs.#{@fs} -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

3 entries across 3 versions & 1 rubygems

Version Path
getch-0.1.0 lib/getch/filesystem/ext4/format.rb
getch-0.0.9 lib/getch/filesystem/ext4/format.rb
getch-0.0.8 lib/getch/filesystem/ext4/format.rb