-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
build.rb
executable file
·117 lines (111 loc) · 2.17 KB
/
build.rb
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env ruby -wU
PLACEHOLDERS = {
'RUBY_SETUP_VERSION' => "3.3.5",
'NVM_VERSION' => "0.39.1",
'NODE_VERSION' => "20.17.0",
'GEMS' => "colored faker http pry-byebug rake rails:7.1.3.4 rest-client rspec rubocop-performance sqlite3:1.7.3 activerecord:7.1.3.2"
}
MACOS = %w[
intro
macos_zoom
github
macos_command_line_tools
macos_homebrew
macos_vscode
vscode_extensions
vscode_liveshare
macos_terminal
oh_my_zsh
gh_cli
dotfiles
macos_rbenv
ruby
nvm
yarn
macos_sqlite
macos_postgresql
checkup
kitt
macos_slack
slack_settings
macos_settings
conclusion].freeze
WINDOWS = %w[
intro
zoom
github
windows_version
windows_virtualization
windows_wsl
windows_ubuntu
windows_vscode
windows_terminal
vscode_extensions
vscode_liveshare
cli_tools
oh_my_zsh
windows_browser
gh_cli
dotfiles
ssh_agent
rbenv
ruby
nvm
yarn
sqlite
windows_postgresql
checkup
kitt
windows_slack
slack_settings
windows_settings
conclusion].freeze
UBUNTU = %w[
intro
zoom
github
ubuntu_vscode
vscode_extensions
vscode_liveshare
cli_tools
oh_my_zsh
gh_cli
dotfiles
ssh_agent
rbenv
ruby
nvm
yarn
sqlite
ubuntu_postgresql
checkup
kitt
ubuntu_slack
slack_settings
ubuntu_settings
conclusion].freeze
SETUPS = {
"macos.md" => MACOS,
"windows.md" => WINDOWS,
"ubuntu.md" => UBUNTU
}
["", "cn", "es", "fr", "pt"].each do |locale|
SETUPS.each do |filename, partials|
filename = "#{filename.split(".md").first}.#{locale}.md" unless locale.empty?
File.open(filename, "w:utf-8") do |f|
partials.each do |partial|
if !locale.empty? && File.exist?(File.join("_partials/#{locale}", "#{partial}.md"))
partial_content = File.read(File.join("_partials/#{locale}", "#{partial}.md"), encoding: "utf-8")
else
partial_content = File.read(File.join("_partials", "#{partial}.md"), encoding: "utf-8")
end
PLACEHOLDERS.each do |placeholder, value|
partial_content.gsub!("<#{placeholder}>", value)
end
partial_content.gsub!("<OS.md>", filename)
f << partial_content
f << "\n\n"
end
end
end
end