Sha256: 0de248dbda334240a01b72896c9f8ba121dd3ba1bf06554455d87b0253151bbb

Contents?: true

Size: 828 Bytes

Versions: 6

Compression:

Stored size: 828 Bytes

Contents

# frozen_string_literal: true

# takeltau bit check workspace
module BitCheckWorkspace
  # Backend method for bit check workspace.
  # @return [Boolean] is this a bit workspace?
  def bit_check_workspace
    log.debug 'Check if this is a bit workspace'

    status_repo = _bit_check_workspace_bit_repo
    return true if status_repo.exitstatus.zero?

    dir = _bit_check_workspace_dir
    log.debug "No bit workspace found in \"#{dir}\""
    false
  end

  private

  # Check bit repo.
  def _bit_check_workspace_bit_repo
    cmd_bit_repo =
      config.active['cmd_bit_check_workspace_bit_list']

    try cmd_bit_repo
  end

  # Get current working directory.
  def _bit_check_workspace_dir
    cmd_pwd =
      config.active['cmd_bit_check_workspace_pwd']

    stdout_str_dir = run cmd_pwd

    stdout_str_dir.chomp
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
takeltau-0.34.15 lib/takeltau/bit/check/workspace.rb
takeltau-0.34.14 lib/takeltau/bit/check/workspace.rb
takeltau-0.34.13 lib/takeltau/bit/check/workspace.rb
takeltau-0.34.12 lib/takeltau/bit/check/workspace.rb
takeltau-0.34.11 lib/takeltau/bit/check/workspace.rb
takeltau-0.34.9 lib/takeltau/bit/check/workspace.rb