Move the rest of the zsh functions into the dotfiles role

This commit is contained in:
Eryn Wells 2024-10-02 20:08:35 -07:00
parent 01312752fc
commit 398c6f2d18
48 changed files with 50 additions and 9 deletions

View file

@ -0,0 +1,9 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init_site_environments
{
export ERYNWELLS_ME_SITE="$HOME/Developer/erynwells.me"
}
init_site_environments "$@"

View file

@ -0,0 +1,9 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function init_website_environments
{
export ERYNWELLS_ME_SITE="$HOME/Developer/erynwells.me"
}
init_website_environments "$@"

View file

@ -0,0 +1,15 @@
#!/usr/bin/env zsh
autoload init_website_environment
function weeknotes
{
init_website_environment
YEAR=`date '+%Y'`
WEEK_NUMBER=`date '+%V'`
PAGE_PATH=blog/${YEAR}/weeknotes-${YEAR}w${WEEK_NUMBER}.md
UPCOMING_SUNDAY=`${ERYNWELLS_ME_SITE}/scripts/next_sunday.py`
}
weeknotes "$@"

View file

@ -9,7 +9,9 @@ function init-env-fpath
{ {
local -r fpath_candidates=( \ local -r fpath_candidates=( \
"$HOME/.zsh/${SYS}-functions" \ "$HOME/.zsh/${SYS}-functions" \
"$HOME/.zsh/func" \ "$HOME/.zsh/init-env-functions" \
"$HOME/.zsh/init-rc-functions" \
"$HOME/.zsh/functions" \
) )
# Process the array in reverse order (`Oa` means "descending index order", # Process the array in reverse order (`Oa` means "descending index order",

View file

@ -1,5 +1,5 @@
--- ---
- name: (ZSH) Link startup files - name: (zsh) Link startup files
ansible.builtin.file: ansible.builtin.file:
path: ~/.{{ item }} path: ~/.{{ item }}
src: "{{ role_path }}/files/zsh/{{ item }}" src: "{{ role_path }}/files/zsh/{{ item }}"
@ -10,16 +10,22 @@
- zshrc - zshrc
- zprofile - zprofile
- name: (ZSH) Link env functions - name: (zsh) Create zsh directories
ansible.builtin.file: ansible.builtin.file:
path: ~/.zsh/init-env-functions path: "{{ item }}"
src: "{{ role_path }}/files/zsh/init-env-functions" state: directory
state: link
force: true force: true
loop:
- ~/.zsh
- ~/.zsh/cache
- name: (ZSH) Link rc functions - name: (zsh) Link function library directories
ansible.builtin.file: ansible.builtin.file:
path: ~/.zsh/init-rc-functions path: ~/.zsh/{{ item }}
src: "{{ role_path }}/files/zsh/init-rc-functions" src: "{{ role_path }}/files/zsh/{{ item }}"
state: link state: link
force: true force: true
loop:
- init-env-functions
- init-rc-functions
- functions