Module: GitScribe::Init

Included in:
GitScribe
Defined in:
lib/git-scribe/init.rb

Instance Method Summary collapse

Instance Method Details

#init(args = []) ⇒ Object

start a new scribe directory with skeleton structure



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/git-scribe/init.rb', line 4

def init(args = [])
  name = first_arg(args)
  die("needs a directory name") if !name
  die("directory already exists") if File.exists?(name)

  info "inititalizing #{name}"
  from_stdir = File.join(SCRIBE_ROOT, 'template')
  ign = Dir.glob(from_stdir + '/.[a-z]*')
  FileUtils.cp_r from_stdir, name
  FileUtils.cp_r ign, name
end