lib/hotplate/cli/init.rb in hotplate-0.0.5 vs lib/hotplate/cli/init.rb in hotplate-0.1.0
- old
+ new
@@ -1,11 +1,11 @@
require 'FileUtils'
def java
puts "What is your Team Number? (0000)"
team = gets.chop!.to_i.to_s # Ensures it's a proper number :)
- clazz = "#{@path}/src/main/java/frc/team#{team}/#{@name}/RobotModule.java"
+ clazz = "#{@path}/src/main/java/frc/team#{team}/#{@name.downcase}/RobotModule.java"
jin = File.expand_path "../../java", __FILE__
#puts Dir[jin]
FileUtils.cp_r "#{jin}/.", @path
build = File.read File.join(@path, "build.gradle")
@@ -21,11 +21,14 @@
FileUtils.mkdir_p File.expand_path("..", clazz)
File.write clazz, template
File.delete templ
begin
- FileUtils.chmod 0777, %w(build.gradle, gradlew)
- rescue; end
+ FileUtils.chmod 0777, [File.join(@path, "gradlew"), File.join(@path, "build.gradle")]
+ rescue => e
+ puts "NOTE: Could not CHMOD gradle files"
+ puts e.backtrace
+ end
end
def javascript
puts "What is your main script class name? [main.js]"
name = gets.chop!