This commit is contained in:
2019-08-23 12:30:36 -05:00
parent 5c7d639ebc
commit 2aba7529ae
4 changed files with 91 additions and 38 deletions

View File

@@ -27,6 +27,8 @@ base_lightgrey="120;120;120m"
base_darkgrey_01="60;60;60m" base_darkgrey_01="60;60;60m"
base_darkgrey_02="50;50;50m" base_darkgrey_02="50;50;50m"
base_black="0;0;0m" base_black="0;0;0m"
base_lime="0;255;0m"
base_aqua="0;255;255m"
l_grey_rgb="120;120;120m" l_grey_rgb="120;120;120m"
m_grey_rgb="80;80;80m" m_grey_rgb="80;80;80m"
@@ -42,6 +44,8 @@ d_lightgrey="${esc_seq_fg}${base_lightgrey}"
fg_darkgrey_01="${esc_seq_fg}${base_darkgrey_01}" fg_darkgrey_01="${esc_seq_fg}${base_darkgrey_01}"
fg_darkgrey_02="${esc_seq_fg}${base_darkgrey_02}" fg_darkgrey_02="${esc_seq_fg}${base_darkgrey_02}"
fg_black="${esc_seq_fg}${base_black}" fg_black="${esc_seq_fg}${base_black}"
fg_lime="${esc_seq_fg}${base_lime}"
fg_aqua="${esc_seq_fg}${base_aqua}"
# Named background colors # Named background colors
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -52,6 +56,8 @@ bg_lightgrey="${esc_seq_fg}${c_white}${esc_seq_bg}${base_lightgrey}"
bg_darkgrey_01="${esc_seq_fg}${c_white}${esc_seq_bg}${base_darkgrey_01}" bg_darkgrey_01="${esc_seq_fg}${c_white}${esc_seq_bg}${base_darkgrey_01}"
bg_darkgrey_02="${esc_seq_fg}${c_white}${esc_seq_bg}${base_darkgrey_02}" bg_darkgrey_02="${esc_seq_fg}${c_white}${esc_seq_bg}${base_darkgrey_02}"
bg_black="${esc_seq_fg}${c_white}${esc_seq_bg}${base_black}" bg_black="${esc_seq_fg}${c_white}${esc_seq_bg}${base_black}"
bg_lime="${esc_seq_fg}${c_white}${esc_seq_bg}${base_lime}"
bg_aqua="${esc_seq_fg}${c_white}${esc_seq_bg}${base_aqua}"
# Color variations and special use cases # Color variations and special use cases
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View File

@@ -8,12 +8,16 @@ source ./_lib/c/base.sh
# UI colors # UI colors
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
ui_base="${lightgrey_bg}" ui_base="${bg_lightgrey}"
ui_accent_light="${lightpurple}" ui_accent_light="${fg_lightpurple}"
ui_accent_dark="${darkpurple}" ui_accent_dark="${fg_darkpurple}"
ui_text_normal="" ui_text_normal=""
ui_text_muted="${lightgrey}" ui_text_hl="${fg_ff4500}"
ui_dialog_bg="${darkgrey_bg}" ui_text_muted="${fg_lightgrey}"
ui_dialog_bg="${bg_darkgrey_01}"
ui_highlight_bg="${bg_ff4500}"
ui_text_info="${fg_lime}"
ui_text_cmd="${fg_aqua}"
# for var in "${!ui_@}"; do # for var in "${!ui_@}"; do
# printf '%s=%s\n' "$var" "${!var}" # printf '%s=%s\n' "$var" "${!var}"

View File

@@ -9,20 +9,19 @@
# User specified directories (no trailing slashes!) # User specified directories (no trailing slashes!)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
base_dir="~/Desktop/test" base_dir="$HOME/Desktop/test"
source_repo_dir="repos" source_repo_dir="repos"
output_dir="archive" output_dir="archive"
repo_list="${base_dir}/_src/repo_list.txt" repo_list="${base_dir}/_src/repo_list.txt"
# Variables for functions - Don't mess with these # Variables for functions - Don't mess with these
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
filelines="$(cat $repo_list)"
source="${base_dir}/${source_repo_dir}" source="${base_dir}/${source_repo_dir}"
output="${base_dir}/${output_dir}" output="${base_dir}/${output_dir}"
# Debugging # Debugging
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
print_colors="yes" print_colors="no"
# Colors - source the colors.sh file # Colors - source the colors.sh file
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View File

@@ -11,8 +11,8 @@ indent() {
# ----------------------------------------------- # -----------------------------------------------
sep() { sep() {
local ch="-" local ch="-"
local sep_line="$(printf '%*s' "60" | tr ' ' "$ch")" local sep_line="$(printf '%*s' "56" | tr ' ' "$ch")"
echo -e "${indent}${grey}${sep_line}${reset}${indent}" echo -e "${ind}${fg_darkgrey_01}${sep_line}${reset}${ind}"
#echo -e "-----------------------------------------------------------------------------" #echo -e "-----------------------------------------------------------------------------"
} }
@@ -20,39 +20,81 @@ aaa() {
echo -e "${fg_darkgrey_01} -------------------------------------------------------- ${reset}" echo -e "${fg_darkgrey_01} -------------------------------------------------------- ${reset}"
} }
# Check directory existence info(){
indent; indent; echo -e "${bg_darkgrey_02}${ui_text_info} i ${reset} \c"
}
cmd(){
indent; indent; echo -e "${bg_darkgrey_02} ${reset}"
indent; indent; echo -e "${bg_darkgrey_02}${ui_text_cmd} > ${reset}${fg_darkgrey_01} \$ ${reset}\c"
}
sec_hl(){
indent; indent; echo -e "${bg_lightpurple} $1 ${reset}";
echo
}
line(){
echo -e $1
}
line_2(){
indent; indent; echo -e "${bg_darkgrey_02} ${reset} \c"; echo -e $1
}
# Check directory/file existence
# ----------------------------------------------- # -----------------------------------------------
aaa
check_ex(){
echo
sep
echo echo
sec_hl "Checking for required files/folders:"
if [ ! -d "${base_dir}" ]; then if [ ! -d "${base_dir}" ]; then
indent; indent; echo -e "Base dir doesn't exist. Making it now." info; line "${fg_lightgrey}Base dir${reset} doesn't exist."; line_2 "Making it now."
indent; indent; echo -e "> mkdir ${base_dir}" cmd; line "${fg_lightgrey}mkdir ${base_dir}${reset}"
echo echo; sleep 1
#mkdir ${source} mkdir ${base_dir}
else else
echo -e "Base dir exists at ${base_dir}" info; line "Base dir exists at ${ui_text_cmd}${base_dir}${reset}"
echo
fi fi
if [ ! -d "${source}" ]; then if [ ! -d "${source}" ]; then
indent; indent; echo -e "Source dir doesn't exist. Making it now." info; line "${fg_lightgrey}Source dir${reset} doesn't exist."; line_2 "Making it now."
indent; indent; echo -e "> mkdir ${source}" cmd; line "${fg_lightgrey}mkdir ${source}${reset}"
echo echo; sleep 1
#mkdir ${source} mkdir ${source}
else else
echo -e "Source dir exists at ${source}" info; line "Source dir exists at ${ui_text_cmd}${source}${reset}"
echo
fi fi
if [ ! -d "${output}" ]; then if [ ! -d "${output}" ]; then
indent; indent; echo -e "Output dir doesn't exist. Making it now." info; line "${fg_lightgrey}Output dir${reset} doesn't exist."; line_2 "Making it now."
indent; indent; echo -e "> mkdir ${output}" cmd; line "${fg_lightgrey}mkdir ${output}${reset}"
#mkdir ${output} echo; sleep 1
mkdir ${output}
else else
echo -e "Output dir exists at ${output}" info; line "Output dir exists at ${ui_text_cmd}${output}${reset}"
echo
fi
if [ ! -f "${repo_list}" ]; then
info; line "A ${fg_lightgrey}repository list${reset} doesn't exist."; line_2 "Making the ${ui_text_cmd}_src${reset} dir and an empty list now."
cmd; line "${fg_lightgrey}touch ${repo_list}${reset}"
echo; sleep 1
mkdir ${base_dir}/_src && touch ${repo_list}
else
info; line "A repository list exists at ${ui_text_cmd}${repo_list}${reset}"
echo
fi fi
echo echo
aaa sep
}
# # Clone everything in repo_list to source folder # # Clone everything in repo_list to source folder
# # ----------------------------------------------- # # -----------------------------------------------
@@ -85,6 +127,7 @@ aaa
# ----------------------------------------------- # -----------------------------------------------
zzz (){ zzz (){
filelines="$(cat $repo_list)"
for line in $filelines; do for line in $filelines; do
suffix=".git" suffix=".git"
pre="${line##*/}" pre="${line##*/}"
@@ -113,9 +156,10 @@ zzz (){
#zzz #zzz
run() { run() {
check_ex
echo echo
sep sep
indent; echo "Yay" indent; indent; echo "Yay"
sep sep
echo echo
aaa aaa