Skip to content

Commit

Permalink
fix the messed up default file finder paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Chacon committed Feb 15, 2011
1 parent cdd6449 commit 6c457b3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/git-scribe.rb
Expand Up @@ -7,6 +7,8 @@

class GitScribe

SCRIBE_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))

def initialize(args)
@command = args.shift
@args = args
Expand Down Expand Up @@ -73,7 +75,9 @@ def prepare_output_dir
Dir.mkdir('output') rescue nil
Dir.chdir('output') do
Dir.mkdir('stylesheets') rescue nil
from_stdir = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'stylesheets'))
puts SCRIBE_ROOT
from_stdir = File.join(SCRIBE_ROOT, 'stylesheets')
pp from_stdir
FileUtils.cp_r from_stdir, '.'
end
end
Expand Down Expand Up @@ -110,7 +114,7 @@ def local(file)
end

def base(file)
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', file))
File.join(SCRIBE_ROOT, file)
end

def do_epub
Expand Down Expand Up @@ -187,7 +191,7 @@ def do_site
content.gsub!(s['href'], s['link'])
end

template_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'site', 'default'))
template_dir = File.join(SCRIBE_ROOT, 'site', 'default')

# copy the template files in
files = Dir.glob(template_dir + '/*')
Expand Down

0 comments on commit 6c457b3

Please sign in to comment.