-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfigure
executable file
·40 lines (35 loc) · 1.06 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env ruby
# 获取文件权限
$current_dir = File.dirname(File.expand_path(__FILE__))
Dir[File.join($current_dir, "setup/*.rb")].each do |file|
require_relative(file)
end
# README替换
FileUtils.mv "POD_README.md", "README.md"
# 获取参数
size = ARGV.size
pod_name = ""
pod_languge = ""
if size == 0
puts 'Running Error!!!please input correct project name and develop languge'.red
puts ''
elsif size == 1
pod_name = ARGV[0]
pod_languge = "ObjC"
File.rename('../' + File.basename(Dir.getwd), '../' + pod_name)
puts "Project:#{pod_name}".green
puts "Language:#{pod_languge} [ Default ]".green
elsif size >= 2
pod_name = ARGV[0]
pod_languge = ARGV[1]
if pod_languge.downcase == 'objc'
pod_languge = "ObjC"
elsif pod_languge.downcase == 'swift'
pod_languge = "Swift"
end
File.rename('../' + File.basename(Dir.getwd), '../' + pod_name)
puts "Project:#{pod_name}".green
puts "Language:#{pod_languge}".green
end
# 模板配置器初始化
Pod::TemplateConfigurator.new(pod_name, pod_languge).run