mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 23:42:53 +08:00
15 lines
424 B
Ruby
15 lines
424 B
Ruby
# Creates a new PhoneGap/Android project from ./example
|
|
class Generate
|
|
def initialize(name)
|
|
if name.nil?
|
|
puts "You need to supply a name to generate a project. Try this:\n\ndroidgap gen MyApp\n\n"
|
|
return
|
|
end
|
|
from = File.join ROOT, "example"
|
|
to = File.join FileUtils.pwd, name
|
|
FileUtils.cp_r from, to
|
|
Create.new(to)
|
|
FileUtils.rm_rf to
|
|
FileUtils.mv "#{ to }_android", to
|
|
end
|
|
end |