Sha256: 72a420c9058904315f4c8c74715c5f2eab9f344f1adef33a2d6feafc2f5fa878

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

# frozen_string_literal: true

require 'rake_factory'
require 'ruby_git_crypt'
require 'open4'

module RakeGitCrypt
  module Tasks
    class Lock < RakeFactory::Task
      default_name :lock
      default_description 'Lock git-crypt.'

      parameter :key_name
      parameter :force, default: false
      parameter :all, default: false

      action do
        puts('Locking git-crypt...')
        begin
          RubyGitCrypt.lock(
            key_name: key_name,
            force: force,
            all: all
          )
          puts('Locked.')
        rescue Open4::SpawnError
          puts('Already locked.')
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rake_git_crypt-0.1.0.pre.19 lib/rake_git_crypt/tasks/lock.rb