Skip to content

Commit

Permalink
Add .gitignore to scaffold (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
vassilvk authored Nov 10, 2017
1 parent 2cd7335 commit c2d67a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion bin/slacker_new
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ def slacker_new(project_name)
files = Dir.glob("#{project_template_path}/**")
FileUtils.mkdir(project_name) unless File.exist?(project_name)
FileUtils.cp_r(files, project_name)

# Rename file "gitignore" to ".gitignore".
# This is necessary because we cannot carry dotfiles with the gem, hence the file is carried as "gitignore".
File.rename("#{project_name}/gitignore", "#{project_name}/.gitignore")
end

def project_template_files(project_name)
files = Dir.glob("#{project_template_path}/**/*").map{|file| file.gsub(/^#{Regexp.escape(project_template_path)}\//, "./#{project_name}/")}
files = Dir.glob("#{project_name}/**/*").map{|file| file.gsub(/^#{Regexp.escape(project_template_path)}\//, "./#{project_name}/")}
end

if ARGV.count != 1
Expand Down
2 changes: 1 addition & 1 deletion lib/slacker/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Slacker
VERSION = "1.0.19"
VERSION = "1.0.20"
end
1 change: 1 addition & 0 deletions lib/slacker_new/project/gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debug/

0 comments on commit c2d67a2

Please sign in to comment.