-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from suyashmahar/version/1.1
🎉 Version 1.1
- Loading branch information
Showing
6 changed files
with
150 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Gitignore configurations for emacs | ||
# -*- mode: gitignore; -*- | ||
*~ | ||
\#*\# | ||
/.emacs.desktop | ||
/.emacs.desktop.lock | ||
*.elc | ||
auto-save-list | ||
tramp | ||
.\#* | ||
|
||
# Org-mode | ||
.org-id-locations | ||
*_archive | ||
|
||
# flymake-mode | ||
*_flymake.* | ||
|
||
# eshell files | ||
/eshell/history | ||
/eshell/lastdir | ||
|
||
# elpa packages | ||
/elpa/ | ||
|
||
# reftex files | ||
*.rel | ||
|
||
# AUCTeX auto folder | ||
/auto/ | ||
|
||
# cask packages | ||
.cask/ | ||
dist/ | ||
|
||
# Flycheck | ||
flycheck_*.el | ||
|
||
# server auth directory | ||
/server/ | ||
|
||
# projectiles files | ||
.projectile | ||
|
||
# directory configuration | ||
.dir-locals.el |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#! /usr/bin/env bash | ||
|
||
# Contains functions for handling all custom .gitignore | ||
# directory related features | ||
|
||
function load_dirs() { | ||
if [ -f "${SCRIPTPATH}/dirs.list" ]; then | ||
dirNames=`cat ${SCRIPTPATH}/dirs.list` | ||
else | ||
echo "WARNING: Directory list not compiled" | ||
echo "INFO: Adding default default gitignore directories." | ||
|
||
# Add 2 default locations present in github's repository | ||
echo ":${SCRIPTPATH}/gitignore" >> "${SCRIPTPATH}/dirs.list" | ||
if [ -d "${SCRIPTPATH}/global" ]; then | ||
echo "global:${SCRIPTPATH}/global" >> "${SCRIPTPATH}/dirs.list" | ||
fi | ||
|
||
load_dirs | ||
return | ||
fi | ||
|
||
# Read each line from dirs.list and add an entry to map. | ||
# Lines in dirs.list have pattern: | ||
# alias:path | ||
while read -r line; do | ||
lineSplit=("$line") | ||
dirNameMap["${lineSplit[0]}"]="${lineSplit[1]}" | ||
done < "${SCRIPTPATH}/dirs.list" | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#! /usr/bin/env bash | ||
|
||
# From: https://stackoverflow.com/a/38153758/6556360 | ||
# parse the arguments. | ||
parse_params () | ||
{ | ||
local existing_named | ||
local ARGV=() | ||
echo "local ARGV=(); " | ||
while [[ "$1" != "" ]]; do | ||
# If equals delimited named parameter | ||
if [[ "$1" =~ ^..*=..* ]]; then | ||
# key is part before first = | ||
local _key=$(echo "$1" | cut -d = -f 1) | ||
# val is everything after key and = (protect from param==value error) | ||
local _val="${1/$_key=}" | ||
# remove dashes from key name | ||
_key=${_key//\-} | ||
# search for existing parameter name | ||
if (echo "$existing_named" | grep "\b$_key\b" >/dev/null); then | ||
# if name already exists then it's a multi-value named parameter | ||
# re-declare it as an array if needed | ||
if ! (declare -p _key 2> /dev/null | grep -q 'declare \-a'); then | ||
echo "$_key=(\"\$$_key\");" | ||
fi | ||
# append new value | ||
echo "$_key+=('$_val');" | ||
else | ||
# single-value named parameter | ||
echo "local $_key=\"$_val\";" | ||
existing_named=" $_key" | ||
fi | ||
# If standalone named parameter | ||
elif [[ "$1" =~ ^\-. ]]; then | ||
# remove dashes | ||
local _key=${1//\-} | ||
echo "local $_key=\"$_key\";" | ||
# non-named parameter | ||
else | ||
# escape asterisk to prevent bash asterisk expansion | ||
_escaped=${1/\*/\'\"*\"\'} | ||
echo "ARGV+=('$_escaped');" | ||
fi | ||
shift | ||
done | ||
} |
This file contains 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