Skip to content

Instantly share code, notes, and snippets.

@seancdavis
Created November 17, 2014 18:45
Show Gist options
  • Save seancdavis/df875dd15ff8fbd755d9 to your computer and use it in GitHub Desktop.
Save seancdavis/df875dd15ff8fbd755d9 to your computer and use it in GitHub Desktop.
Simple command line script using Ruby (http://goo.gl/3qcCnv)
#!/usr/bin/env ruby
# Include libraries
#
require 'fileutils'
# Make sure we have our argument
#
if ARGV.size < 1
puts "Usage: project [DIR]"
exit
else
dir = ARGV.first
end
# Create our subdirectories
#
(1..3).to_a.each { |i| FileUtils.mkdir_p("#{dir}/dir_#{i}") }
# Create README file
#
FileUtils.touch("#{dir}/README.md")
# Tell the user we're all done
#
puts "Project #{dir} created!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment