]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - shell/shell/functions
Move to shell/ in preparation for merge into new dotfiles repository
[config/dotfiles.git] / shell / shell / functions
diff --git a/shell/shell/functions b/shell/shell/functions
new file mode 100644 (file)
index 0000000..838968b
--- /dev/null
@@ -0,0 +1,30 @@
+# Shell functions useful to all shells.
+
+# Copyright (C) 2011-2014  Simon Ruderich
+#
+# This file is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+
+
+# Source $1 if it exists. And $1.local if it exists as well.
+source_config() {
+    if test -f "$1"; then
+        . "$1"
+    fi
+
+    if test -f "$1.local"; then
+        . "$1.local"
+    fi
+}
+
+# vim: ft=sh