From: Armaan Bhojwani <3fb650a9-b47e-4604-a282-1dd91953b2ee@anonaddy.me> Date: Thu, 15 Oct 2020 18:08:44 +0000 (-0400) Subject: fixed excess copying X-Git-Url: https://git.armaanb.net/?p=charsel.git;a=commitdiff_plain;h=a83d035291f0d6f0f33923972ffd67a25a069219 fixed excess copying --- diff --git a/src/charsel b/src/charsel index f435fde..84c0aff 100755 --- a/src/charsel +++ b/src/charsel @@ -1,9 +1,12 @@ #!/usr/bin/env bash # Merge both global and local charfiles CHARDIR=~/.cache/charsel -mkdir $CHARDIR/ -cp -R /usr/share/charsel/* $CHARDIR/ -cp -R ~/.local/share/charsel/* $CHARDIR/ + +if [[ ! "$(ls -A $CHARDIR)" || ! -d $CHARDIR ]]; then + mkdir $CHARDIR/ + cp -R /usr/share/charsel/* $CHARDIR/ + cp -R ~/.local/share/charsel/* $CHARDIR/ +fi # Check if user provided an input if [ $1 = "list" ]; then