Up.
This commit is contained in:
parent
51d951f7e5
commit
96fd444a48
@ -0,0 +1,36 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Logging function
|
||||||
|
log() {
|
||||||
|
printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
inf() {
|
||||||
|
printf "$(tput setaf 2)╚═══ᐳ $(tput sgr 0 1)$(tput setaf 2)%s$(tput sgr0)\n" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
COMMAND_FILE=${HOME}/.config/ranger/commands.py
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
log "Begin ranger finalization"
|
||||||
|
|
||||||
|
case $(grep -Fx "from plugins.ranger_udisk_menu.mounter import mount" "${COMMAND_FILE}" )
|
||||||
|
0)
|
||||||
|
# found, do nothing
|
||||||
|
inf "Modification not needed."
|
||||||
|
;;
|
||||||
|
1)
|
||||||
|
# not found, add it
|
||||||
|
sed -i '10 i from plugins.ranger_udisk_menu.mounter import mount' ${COMMAND_FILE}
|
||||||
|
inf "Add line for mount plugin."
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# an error occurred
|
||||||
|
inf "An error occured."
|
||||||
|
;;
|
||||||
|
|
||||||
|
log "Finish ranger finalization"
|
||||||
|
|
@ -17,10 +17,10 @@ TEXMF=texmf/tex/latex
|
|||||||
|
|
||||||
|
|
||||||
{{- if (ne .latex false) -}}
|
{{- if (ne .latex false) -}}
|
||||||
log "Begin LaTeX initialization"
|
log "Begin LaTeX repo initialization"
|
||||||
|
|
||||||
texhash "${HOME}/${TEXMF}"
|
texhash "${HOME}/${TEXMF}"
|
||||||
|
|
||||||
log "Finish LaTeX initialization"
|
log "Finish LaTeX repo initialization"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user