Skip to content

Commit

Permalink
Merge pull request #140 from zhisme/dir-existence
Browse files Browse the repository at this point in the history
Add detection of project folders
  • Loading branch information
nskins committed Jan 26, 2019
2 parents 1254fc9 + 4e733c0 commit a566c23
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/goby/scaffold.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ module Scaffold
#
# @param [String] project the project name.
def self.simple(project)

# TODO: detect existence of project folder.

# Make the directory structure.
Dir.mkdir project
Dir.mkdir project unless Dir.exist? project
dirs = [ '', 'battle', 'entity',
'event', 'item', 'map' ]
dirs.each do |dir|
Dir.mkdir "#{project}/src/#{dir}"
Dir.mkdir "#{project}/src/#{dir}" unless Dir.exist? "#{project}/src/#{dir}"
end

# Create the source files.
Expand Down

0 comments on commit a566c23

Please sign in to comment.