Remove codetemplates/ and remove ZSH makers module -- I haven't used either in years

This commit is contained in:
Eryn Wells 2022-01-22 10:24:39 -08:00
parent b6146c816b
commit ff2666c518
15 changed files with 0 additions and 337 deletions

View file

@ -1,73 +0,0 @@
#!/bin/zsh
# Create a code module
# Eryn Wells <eryn@erynwells.me>
local opts='Ccmph'
local funcname=$0
_usage() {
print_info "Usage: $funcname [-$opts] mod_name [mod_name] ..." 1>&2
}
if [[ ${#@} -lt 2 ]]; then
print_error "Insufficient number of arguments" 1>&2
_usage
return -1
fi
local opt
local complete=0
local srcext=''
local headext=''
local modtype=''
while getopts $opts opt; do
[[ $complete -eq 1 ]] && return 2
case $opt in
C)
modtype='C++'
srcext='cc'
headext='hh'
;;
c)
modtype='C'
srcext='c'
headext='h'
;;
m)
modtype='Objective-C'
srcext='m'
headext='h'
;;
p)
modtype='Python'
srcext='py'
;;
h)
_usage
return 0
;;
*)
print_error "Invalid argument: $opt" 1>&2
_usage
return 1
;;
esac
complete=1
done
if [[ -z $opt ]]; then
_usage
return -1
fi
print_info "Creating $modtype modules"
for mod in $@[$OPTIND,${#@}]; do
print_info_sub $mod
[[ -n $srcext ]] && touch $mod.$srcext
[[ -n $headext ]] && touch $mod.$headext
done
unfunction _usage
return 0

View file

@ -1,58 +0,0 @@
#!/bin/zsh
# Create a Django project using a template in .dotfiles/codetemplates/django
# Eryn Wells <eryn@erynwells.me>
function usage_mkdjango
{
cat <<EOF
Usage: $0 template_name project_name [optional destination directory]"
Create a Django project named [project_name] based on the specified template
[template_name]. If no [destination directory] is given, the project is
created in the current one.
EOF
}
function mkdjango
{
if [[ ${#@} -lt 2 ]]; then
print_error "Need moar arguments" 1>&2
usage_mkdjango $0
return -1
fi
local tname=$1
local tdir="$HOME/.codetemplates/django/$tname"
local pname=$2
local dest=$3
if [[ ! -d "$tdir" ]]; then
print_error "Invalid template name: $tname" 1>&2
return -2
fi
print_info "Making Django project '$pname' with template '$tname'"
if [[ -n "$dest" && ! -d "$dest" ]]; then
print_info_sub "Destination directory given but does not exist; creating $dest"
mkdir -p "$dest"
fi
# Determine what files might not be rendered by django-admin.py
local names=()
for f in `ls -A "$tdir"`; do
# Pick up dotfiles
if [[ -e "$f" && "$f" =~ "^\." ]]; then
names+=("$f")
fi
done
print_info_sub "Calling django-admin.py"
django-admin.py startproject --template="$tdir" --name=${(j.,.)names} "$pname" "$dest"
exitcode=$?
return $exitcode
}
mkdjango $@

View file

@ -1,18 +0,0 @@
#!/bin/zsh
# Make a Maildir directory
# Eryn Wells <eryn@erynwells.me>
function mkmdir
{
if [[ $#@ -lt 1 ]]; then
echo "Usage: $0 [maildir ...]"
exit 1
fi
for d in $@; do
print_info "Making maildir: $d"
mkdir -p "$d"/{new,cur,tmp}
done
}
mkmdir "$@"