diff options
| author | realtradam <[email protected]> | 2022-04-21 07:55:45 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2022-04-21 07:55:45 -0400 |
| commit | 8c0569bf34405dfdf0968b26f33dd70976866943 (patch) | |
| tree | 321cc6e1b0840b0eebf84523dcd6486cabaab3c6 /exe/justicar | |
| download | Justicar-8c0569bf34405dfdf0968b26f33dd70976866943.tar.gz Justicar-8c0569bf34405dfdf0968b26f33dd70976866943.zip | |
initv0.1.0
Diffstat (limited to 'exe/justicar')
| -rw-r--r-- | exe/justicar | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/exe/justicar b/exe/justicar new file mode 100644 index 0000000..efd75af --- /dev/null +++ b/exe/justicar @@ -0,0 +1,26 @@ +#!/bin/ruby + +require 'fileutils' + +template_path = File.expand_path(File.dirname(__FILE__) + '/../template') + +def help + puts 'Pass a path as an argument to generate a new project' +end + +if ARGV.length == 0 || ARGV.first.chars.first == '-' + help +elsif ARGV.length == 1 + begin + if ARGV.first.chars.first == '/' + FileUtils.copy_entry(template_path, ARGV.first) + else + FileUtils.copy_entry(template_path, "#{Dir.pwd}/#{ARGV.first}") + end + puts "Project generated" + rescue + help + end +else + help +end |
