From f59b2bd1d4f8ff3548af12e9ca9367562e60373c Mon Sep 17 00:00:00 2001 From: p4bl0 Date: Fri, 23 Jul 2010 03:02:23 +0200 Subject: in fact a Makefile makes no sens here, what I'll need is juste un build script. Thus src dir has no more any reason to be --- install.sh | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 install.sh (limited to 'install.sh') diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..a14c8c8 --- /dev/null +++ b/install.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +replace_var_by_string() { + sed "s//$2/" +} + +fugitive_write_template() { + name=`git config --get user.name` + base64 -d | gunzip | replace_var_by_string name "$name" | \ + replace_var_by_string year "`date +%Y`" +} + +fugitive_install() { + DIR="." + if [ "$1" != "" ]; then DIR="$1"; fi + if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi + cd "$DIR" + echo -n "Creating new git repository... " + git init >/dev/null + echo "done." + echo -n "Creating default directory tree... " + mkdir -p fugitive/{drafts,articles,templates} + echo "done." + echo -n "Adding default directory paths to git config... " + git config --add --path fugitive.templates-dir "fugitive/templates" + git config --add --path fugitive.articles-dir "fugitive/articles" + git config --add --path fugitive.public-dir "." + echo "done." + echo -n "Writing default template files... " + fugitive_write_template > fugitive/templates/article.html < fugitive/templates/archives.html < fugitice.css < .git/hooks/post-commit < .git/hooks/post-receive </dev/null + git commit -m "fugitive inital import" >/dev/null + echo "done." + echo -n "Preventing git to track generated html files... " + (base64 -d | gunzip) > .git/info/exclude <&2;; + "--install") fugitive_install "$2";; + "--install-hooks") fugitive_install_hooks "$2";; + *) fugitive_usage >&2;; +esac -- cgit v1.2.3