Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: e06474803f
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (22 sloc) 0.793 kB
# -*- encoding: utf-8 -*-
# coding: utf-8
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
# This file is used by Rack-based servers to start the application.
require File.dirname(__FILE__) + "/git-wiki"
require "yaml"
require "grit"
$CONFIG = YAML.load(File.read(File.expand_path("~/wiki.yaml", __FILE__)))
unless File.exists? $CONFIG["wiki_repo_path"]
Dir.mkdir $CONFIG["wiki_repo_path"]
end
begin
Grit::Repo.new($CONFIG["wiki_repo_path"])
rescue Grit::InvalidGitRepositoryError
if `which git`.length > 0
`cd #{$CONFIG["wiki_repo_path"]} && git init`
else
raise "Unknown platform, there is no git binary, please init git repo in the given wiki_repo_path"
end
end
run GitWiki.new($CONFIG["wiki_repo_path"], ".markdown", "Home")
Jump to Line
Something went wrong with that request. Please try again.