aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2021-05-09 19:05:15 -0500
committerToby Vincent <tobyv13@gmail.com>2021-05-09 19:05:15 -0500
commit95ffc44ed69e3c383f74f5e5065aed34818ac50c (patch)
treed56ac1a88d0b96df5760b271010eeb9238f4562a
parent1f68da8622aab4e4394461ba37ac04c4b854e0c7 (diff)
feat: added git keep alias
-rw-r--r--gitconfig5
1 files changed, 4 insertions, 1 deletions
diff --git a/gitconfig b/gitconfig
index cc4ecdd..6c19123 100644
--- a/gitconfig
+++ b/gitconfig
@@ -103,4 +103,7 @@
# create git artifacts
ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi"
- attributes = "!ga() { curl -sL https://gist.githubusercontent.com/tobyvin/70f3671c76016063594ea45edbb97094/raw ;}; ga" \ No newline at end of file
+ attributes = "!ga() { curl -sL https://gist.githubusercontent.com/tobyvin/70f3671c76016063594ea45edbb97094/raw ;}; ga"
+
+ # create and keep an empty directory at the provided path
+ keep = "!gk() { ([ -f $@/.gitkeep ] || (mkdir -p $@ && curl -sL https://api.ef.gy/fortune > $@/.gitkeep)) && (grep -qsxF '!/**/.gitkeep' .gitignore || echo '!/**/.gitkeep' >> .gitignore) ;}; gk" \ No newline at end of file