bashrc, move the project seeding to its own functions and have code-reseed call it, check if the dir exists before cloning.

This commit is contained in:
me
2026-09-29 06:42:30 -07:00
parent de6e2d711d
commit f48555f859
+16 -9
View File
@@ -694,13 +694,7 @@
nomadic-weather.wiki main nomadic-weather.wiki main
EOF EOF
} }
function code-reseed { function code-seed {
# Unseed current projects.
echo -e "\n*** Move old projects to TRASH ***"
unseed_dir="$HOME/TRASH/`date +%Y%m%d_%H%M%S`_UnseededCodeProjects"
mkdir -pv "$unseed_dir"
mv -v $HOME/Code/* "$unseed_dir"/ 2>/dev/null
# Git repo information. # Git repo information.
git_repo_ssh={{ git_repo_ssh }} git_repo_ssh={{ git_repo_ssh }}
git_main_project={{ git_project }} git_main_project={{ git_project }}
@@ -710,7 +704,7 @@
git_projects_to_sync | while read git_project git_branch; do git_projects_to_sync | while read git_project git_branch; do
echo -e "\n*** $git_project ***" echo -e "\n*** $git_project ***"
# Project folder manipulation. # Project folder name manipulation.
dest_folder="$git_project" dest_folder="$git_project"
if [[ "$dest_folder" == "flutter-"* ]]; then if [[ "$dest_folder" == "flutter-"* ]]; then
echo "FLUTTER: Removing 'flutter-' and using '_' rather than '-'." echo "FLUTTER: Removing 'flutter-' and using '_' rather than '-'."
@@ -718,11 +712,24 @@
dest_folder="${dest_folder//-/_}" dest_folder="${dest_folder//-/_}"
fi fi
# Download of the project. # Download the project.
if [[ ! -d $HOME/Code/$dest_folder ]]; then
git clone ${git_repo_ssh_basename}${git_project} \ git clone ${git_repo_ssh_basename}${git_project} \
--branch $git_branch $HOME/Code/$dest_folder --branch $git_branch $HOME/Code/$dest_folder
else
echo "'$dest_folder' already exists, skipping."
fi
done done
} }
function code-reseed {
# Unseed current projects.
echo -e "\n*** Move old projects to TRASH ***"
unseed_dir="$HOME/TRASH/`date +%Y%m%d_%H%M%S`_UnseededCodeProjects"
mkdir -pv "$unseed_dir"
mv -v $HOME/Code/* "$unseed_dir"/ 2>/dev/null
code-seed
}
function_clean_filenames: | function_clean_filenames: |
function clean-filenames() { function clean-filenames() {
# Must provide the directory you'd like to clean all the filenames in. # Must provide the directory you'd like to clean all the filenames in.