From 1c713762aae31c2825ecc30d2de917c81e2208e8 Mon Sep 17 00:00:00 2001 From: p4bl0 Date: Mon, 26 Jul 2010 18:59:25 +0200 Subject: install process must be different for remote and local... too bad --- install.sh | 75 +++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 32 deletions(-) diff --git a/install.sh b/install.sh index 82e26b4..758a49f 100644 --- a/install.sh +++ b/install.sh @@ -35,63 +35,74 @@ fugitive_install() { echo -n "Creating new git repository... " git init >/dev/null echo "done." - echo -n "Creating default directory tree... " - mkdir -p _drafts _articles _templates _public - echo "done." echo -n "Adding default settings to git config... " - git config --add fugitive.blog-url "http://localhost/fugitive/" - git config --add --path fugitive.templates-dir "_templates" - git config --add --path fugitive.articles-dir "_articles" - git config --add --path fugitive.public-dir "_public" + if [ "$2" = "remote" ]; then + git config --add receive.denyCurrentBranch "ignore" + fi + git config --add fugitive.blog-url "" + git config --add fugitive.templates-dir "_templates" + git config --add fugitive.articles-dir "_articles" + git config --add fugitive.public-dir "_public" git config --add fugitive.preproc "" echo "done." - echo -n "Writing default template files... " - fugitive_write_template > _templates/article.html <> .git/info/exclude < _templates/article.html < _templates/archives.html < _templates/archives.html < _templates/top.html < _templates/top.html < _templates/bottom.html < _templates/bottom.html < _templates/feed.xml < _templates/feed.xml < fugitive.css < _public/fugitive.css < print.css < _public/print.css </dev/null - git commit -m "fugitive inital import" >/dev/null - echo "done." - echo -n "Preventing git to track temporary and generated files... " - echo "*~\nindex.html\narchives.html" > .git/info/exclude - echo "done." - echo "Writing dummy article (README) and adding it to the repos... " - (base64 -d | gunzip) > _articles/README </dev/null + git commit -m "fugitive inital import" >/dev/null + echo "done." + echo "Writing dummy article (README) and adding it to the repos... " + (base64 -d | gunzip) > _articles/README </dev/null - echo "done." + git add _articles/README + git ci -m "fugitive: README" >/dev/null + echo "done." + fi cd - >/dev/null echo 'Installation almost complete, please visit your blog :-).' } case "$1" in "--help") fugitive_help >&2;; - "--install") fugitive_install "$2";; + "--install"|"--install-local") fugitive_install "$2" "local";; + "--install-remote") fugitive_install "$2" "remote";; "--install-hooks") fugitive_install_hooks "$2";; *) fugitive_usage >&2;; esac -- cgit v1.2.3