<commit_before>debug() {
  if [[ "$DEBUG" ]]; then
      echo "[DEBUG] $*" | gray 1>&2
  fi
}

cbd-version() {
    declare desc="Displays the version of Cloudbrek Deployer"
    bin-version | green

    echo latest version: | green
    latest-version | yellow
}

cbd-update() {
    declare desc="Updates itself"

    local binver=$(bin-version)
    local lastver=$(latest-version)
    local osarch=$(uname -sm | tr " " _ )
    debug binver=$binver lastver=$lastver osarch=$osarch | gray

    if [[ ${binver} != ${lastver} ]]; then
        debug upgrade needed |yellow
        
        local url=https://github.com/sequenceiq/cloudbreak-deployer/releases/download/v${lastver}/cloudbreak-deployer_${lastver}_${osarch}.tgz
        debug "latest url: $url"
        curl -Ls $url | tar -zx -C /usr/local/bin/
    else
        debug you have the latest version | green
    fi
}

cbd-update-snap() {
    declare desc="Updates itself, from the latest snapshot binary"

    url=$(cci-latest sequenceiq/cloudbreak-deployer)
    debug "Update binary from: $url"
    curl -Ls $url | tar -zx -C /usr/local/bin/

}<commit_msg>fix update-snap command to accept branch as a parameter (defaults to master)<commit_after>debug() {
  if [[ "$DEBUG" ]]; then
      echo "[DEBUG] $*" | gray 1>&2
  fi
}

cbd-version() {
    declare desc="Displays the version of Cloudbrek Deployer"
    bin-version | green

    echo latest version: | green
    latest-version | yellow
}

cbd-update() {
    declare desc="Updates itself"

    local binver=$(bin-version)
    local lastver=$(latest-version)
    local osarch=$(uname -sm | tr " " _ )
    debug binver=$binver lastver=$lastver osarch=$osarch | gray

    if [[ ${binver} != ${lastver} ]]; then
        debug upgrade needed |yellow
        
        local url=https://github.com/sequenceiq/cloudbreak-deployer/releases/download/v${lastver}/cloudbreak-deployer_${lastver}_${osarch}.tgz
        debug "latest url: $url"
        curl -Ls $url | tar -zx -C /usr/local/bin/
    else
        debug you have the latest version | green
    fi
}

cbd-update-snap() {
    declare desc="Updates itself, from the latest snapshot binary"
    declare branch=${1:-master}

    url=$(cci-latest sequenceiq/cloudbreak-deployer $branch)
    debug "Update binary from: $url"
    curl -Ls $url | tar -zx -C /usr/local/bin/

}
{'fraction_non_alphanumeric': 0.1350537634408602, 'fraction_numerical': 0.002150537634408602, 'mean_word_length': 2.870216306156406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3703210', 'n_tokens_mistral': 769, 'n_tokens_neox': 738, 'n_words': 204}