Skip to content

Instantly share code, notes, and snippets.

@Y-Less
Created August 20, 2018 21:04
Show Gist options
  • Select an option

  • Save Y-Less/076472ac983a74e3d13793089fb770df to your computer and use it in GitHub Desktop.

Select an option

Save Y-Less/076472ac983a74e3d13793089fb770df to your computer and use it in GitHub Desktop.
dir.sh used by all.sh
#echo 'dir:'
#echo `pwd`
if [[ "YSI-$1" == "$3" ]];
then
git ls-tree --name-only $GIT_COMMIT "YSI-$1/" | xargs -I files /d/work/rm.sh "$1" "$2" files
elif [[ "$2" == "$3.inc" ]];
then
mv "$3" "YSI-$1/"
#ls "YSI-$1/"
elif [[ "YSI-$1" == "$3" ]];
then
:
#echo "NOPE"
#echo "$3"
elif [[ "YSI_$1" == "$3" ]];
then
git ls-tree --name-only $GIT_COMMIT "YSI_$1/" | xargs -I files /d/work/rm.sh "$1" "$2" files
#ls "YSI-$1/"
else
rm -r "$3"
fi
##echo 'dir:'
##echo `pwd`
#
#do_rm() {
# IFS='.' read -ra p <<< "$3"
#
# if [[ "${p[0]}" == "YSI_$1/$2" ]];
# then
# IFS='/' read -ra x <<< "$3"
# if [[ "${p[1]}" == "md" ]];
# then
# mv "$3" "YSI-$1/README.md"
# else
# mv "$3" "YSI-$1/"
# fi
# #else
# # rm -r "$3"
# fi
#}
#
#do_dir(){
# if [[ "$2" == "$3.inc" ]];
# then
# mv "$3" "YSI-$1/"
# elif [[ "YSI-$1" == "$3" ]];
# then
# :
# #echo "NOPE"
# #echo "$3"
# elif [[ "YSI_$1" == "$3" ]];
# then
# git ls-tree --name-only HEAD "YSI_$1/" | xargs -I@ "$(declare -f do_rm) ; do_rm $1 $2 @"
# ls "YSI-$1/"
# else
# rm -r "$3"
# fi
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment