Created
November 17, 2014 18:45
-
-
Save seancdavis/df875dd15ff8fbd755d9 to your computer and use it in GitHub Desktop.
Simple command line script using Ruby (http://goo.gl/3qcCnv)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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