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:
@@ -692,15 +692,9 @@
|
||||
hugo-rvr dev
|
||||
nomadic-weather dev
|
||||
nomadic-weather.wiki main
|
||||
EOF
|
||||
EOF
|
||||
}
|
||||
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
|
||||
|
||||
function code-seed {
|
||||
# Git repo information.
|
||||
git_repo_ssh={{ git_repo_ssh }}
|
||||
git_main_project={{ git_project }}
|
||||
@@ -710,7 +704,7 @@
|
||||
git_projects_to_sync | while read git_project git_branch; do
|
||||
echo -e "\n*** $git_project ***"
|
||||
|
||||
# Project folder manipulation.
|
||||
# Project folder name manipulation.
|
||||
dest_folder="$git_project"
|
||||
if [[ "$dest_folder" == "flutter-"* ]]; then
|
||||
echo "FLUTTER: Removing 'flutter-' and using '_' rather than '-'."
|
||||
@@ -718,11 +712,24 @@
|
||||
dest_folder="${dest_folder//-/_}"
|
||||
fi
|
||||
|
||||
# Download of the project.
|
||||
git clone ${git_repo_ssh_basename}${git_project} \
|
||||
--branch $git_branch $HOME/Code/$dest_folder
|
||||
# Download the project.
|
||||
if [[ ! -d $HOME/Code/$dest_folder ]]; then
|
||||
git clone ${git_repo_ssh_basename}${git_project} \
|
||||
--branch $git_branch $HOME/Code/$dest_folder
|
||||
else
|
||||
echo "'$dest_folder' already exists, skipping."
|
||||
fi
|
||||
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() {
|
||||
# Must provide the directory you'd like to clean all the filenames in.
|
||||
|
||||
Reference in New Issue
Block a user