#!/usr/bin/env bash source bin/helpers/func.sh # Remove any existing kcm installation if [ -f "/usr/local/bin/kcm" ]; then printfe "%s\n" "yellow" "Removing existing kcm installation..." rm /usr/local/bin/kcm fi if [ -f "/usr/share/bash-completion/completions/kcm" ]; then printfe "%s\n" "yellow" "Removing existing kcm bash completion..." rm /usr/share/bash-completion/completions/kcm fi # Copy binary files to /usr/local/bin printfe "%s\n" "cyan" "Installing kcm..." cp $(pwd)/bin/kcm /usr/local/bin/kcm cp $(pwd)/bin/kcm-completion.bash /usr/share/bash-completion/completions/kcm # In case /etc/kcm/config.yaml does not exist, create it if [ ! -f "/etc/kcm/config.local.yaml" ]; then printfe "%s\n" "cyan" "Creating default configuration file..." mkdir -p /etc/kcm cp $(pwd)/config/config.local.example.yaml /etc/kcm/config.local.yaml fi printfe "%s\n" "green" "Installation complete."