Last active
July 6, 2022 07:21
-
-
Save SIMULATAN/ec8b753a415d408c869775e815e83536 to your computer and use it in GitHub Desktop.
Dotter Blog Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this to your .dotter/global.toml file: | |
# [helpers] | |
# bool = ".dotter/helpers/bool.rhai" | |
# | |
# use like this: | |
# bool my_condition | |
if params[0] == true || params[0] == "true" { | |
"true" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dotfiles() { | |
if [ "$1" != "" ]; then | |
if [ $(echo "$1" | tr '[:upper:]' '[:lower:]') = "github" ]; then | |
# run in subshell to prevent current shell from cd'ing into the dotfiles repo | |
(cd {{dotter.current_dir}} && export REPO=$(git config --get remote.origin.url) && if [ "$REPO" != "" ]; then xdg-open "$REPO" && echo "Opened '$REPO' in your Browser."; else echo No git repo found.; fi) | |
return 0 | |
elif [ -d "{{dotter.current_dir}}/$1" ]; then | |
cd {{dotter.current_dir}}/$1 | |
pwd | |
else | |
echo Directory \'$1\' not found. | |
return 1 | |
fi | |
else | |
cd {{dotter.current_dir}} | |
fi | |
# show all files, except for "." and ".." (current / upper directory) | |
ls -a -I "." -I ".." | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# don't forget to 'chmod +x post_deploy.sh' | |
# rename this to 'post_deploy.sh' and put this file into your '.dotter' folder | |
notify-send "Dotter deployed!" -u low -t 2000 -a "Dotter" -c "transfer.complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment