summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2016-07-09 23:55:23 +0000
committerrsiddharth <s@ricketyspace.net>2016-07-09 23:55:23 +0000
commit6ee0570945821353e30f625c53d5a34651359cfd (patch)
tree3f374d65005d1d94b6a26471e602d755c7cfb566
parent3bfc9f28d16302de3782bf259479abd86c8cc8d9 (diff)
add `make config` mechanism.
`make config` will now install a sample configuration file at `~/.config/git-difme/config`. * Makefile (config, $(config_dir), $(config_file)): new targets. * README.org (the config file): add sub section under `installing` section. * examples/config: add file; sample user config file.
-rw-r--r--Makefile12
-rw-r--r--README.org8
-rw-r--r--examples/config8
3 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7e05c8b..afb8292 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,10 @@ bin=$(HOME)/.bin
git_difme=$(bin)/git-difme
git_difme_src=git-difme.scm
+config_dir = $(HOME)/.config/git-difme
+config_file=$(config_dir)/config
+example_config=examples/config
+
nothing:
@echo "Give me something to make. "
.PHONY: nothing
@@ -14,6 +18,9 @@ nothing:
git-difme: $(git_difme)
.PHONY: git-difme
+config: $(config_file)
+.PHONY: config
+
$(git_difme): $(git_difme_src)
@mkdir -p $(bin)
@touch $@
@@ -24,3 +31,8 @@ $(git_difme): $(git_difme_src)
@echo "Script at" $@
@echo "Add" $(bin) "to PATH"
+$(config_dir):
+ @mkdir -p $@
+
+$(config_file): $(example_config) $(config_dir)
+ @cp -i $< $@
diff --git a/README.org b/README.org
index 63148a9..e096bf9 100644
--- a/README.org
+++ b/README.org
@@ -76,6 +76,14 @@ path=(~/.bin $path)
to =.zshenv=.
+*** the config file
+
+#+BEGIN_SRC bash
+make config
+#+END_SRC
+
+that will install a sample config file at =~/.config/git-difme=.
+
** license
gnu general public license version 3 or higher.
diff --git a/examples/config b/examples/config
new file mode 100644
index 0000000..f4aec4f
--- /dev/null
+++ b/examples/config
@@ -0,0 +1,8 @@
+;; -*- mode: scheme; -*-
+;; public domain. no rights reserved.
+
+(define (difme-repos)
+ (list '("/path/to/git/repo/foo" "M" "D" "?")
+ '("/path/to/git/repo/bar" "M")
+ '("/path/to/git/repo/baz" "M" "?")
+ '("/path/to/git/repo/frb")))