From 4467a42aee94c85868fc4c706669fcf89707bce3 Mon Sep 17 00:00:00 2001 From: p4bl0 Date: Fri, 23 Jul 2010 02:52:43 +0200 Subject: Adding files to the projects Makefile is still empty but not for long I hope. README starts to be something real. src/archives.html is the templates for the archives page. src/exclude is for .git/info/exclude src/install.sh is the main script which will include other when generating fugitive. src/post-receive.sh is still empty for now. --- src/archives.html | 46 +++++++++++++++++++++++++++++++++++ src/exclude | 0 src/install.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/post-receive.sh | 0 4 files changed, 116 insertions(+) create mode 100644 src/archives.html create mode 100644 src/exclude create mode 100644 src/install.sh create mode 100644 src/post-receive.sh (limited to 'src') diff --git a/src/archives.html b/src/archives.html new file mode 100644 index 0000000..9d47769 --- /dev/null +++ b/src/archives.html @@ -0,0 +1,46 @@ + + + + + <?fugitive-install name ?>'s blog: <?fugitive article_title ?> + + + + + + +
+ +
+

's blog

+ Weeks of coding can save you hours of planning. +
+
+
+

Archives

+
+
+ +
+
+ +
+ + diff --git a/src/exclude b/src/exclude new file mode 100644 index 0000000..e69de29 diff --git a/src/install.sh b/src/install.sh new file mode 100644 index 0000000..a14c8c8 --- /dev/null +++ b/src/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 diff --git a/src/post-receive.sh b/src/post-receive.sh new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3