-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_profile
64 lines (54 loc) · 2.09 KB
/
.bash_profile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
# For scripts to use new bash explicitly, copy/paste line 1
# Optionally uncomment line 4 following that to print the current bash version
#echo $BASH_VERSION
#================================================
# Abstraction to source (dot)files
function loadSources(){
files=$1;
for file in $files; do
[ -r "$file" ] &&
[ -f "$file" ] &&
source "$file" &&
echo "$file";
done
unset file
}
# define main configs and load them
main=($HOME/.{path,apps,filesystem,utils,macos});
loadSources "$(echo ${main[*]})";
#loadSources "$(echo ${($HOME/.{exports,path,apps,filesystem,utils,bash_prompt,macos})})";
# Keeping this in case I want to load files/exports/secrets
# automatically for interactive shells
# But why, Paul, why?
#case $- in
# *i*) source ~/.extra
#esac
# load secrets, work, .envs, etc.
function loadExtra(){
source $HOME/.dotfiles/extra/.extra;
#unloadExtra; # unset the variables created by .extra
}
# Load Secondary Fiddly bits;
[ -f "$HOME/.dotfiles/extra/ptg.sh" ] && source "$HOME/.dotfiles/extra/ptg.sh";
[ -f "$HOME/.dotfiles/tools/node/.node" ] && source "$HOME/.dotfiles/tools/node/.node";
#source "$HOME/.dotfiles/tools/node/.node" && echo "node configs loaded";
for badname in $HOME/bin/scripts/.*; do
if [ ! -d "$badname" ]; then # [3]
#echo "$badname";
[ -r "$badname" ] && source "$badname"
fi
done
unset badname
echo "~/bin/scripts loaded..."
# TODOs
# x Dotbot config
# clean up .bashrc/rvm/nvm debacle
# https://medium.com/@webprolific/getting-started-with-dotfiles-43c3602fd789
# https://hackernoon.com/my-minimal-vimrc-config-c1a4d26553ca
# https://github.com/dotphiles/dotphiles/blob/master/deploy/osx
# https://github.com/mathiasbynens/dotfiles/blob/master/.macos
# Keyboards - I think what I meant here is now covered by inputrc
#
# Resources
# 3. https://unix.stackexchange.com/questions/351210/loop-through-files-excluding-directories