forked from lewagon/setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rb
executable file
·106 lines (100 loc) · 1.62 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
#!/usr/bin/env ruby -wU
SETUP_RUBY_VERSION = "2.7.3"
MACOS = %w[
intro
zoom
github
macos_apple_silicon
macos_command_line_tools
macos_homebrew
macos_vscode
vscode_extensions
vscode_liveshare
macos_terminal
oh_my_zsh
ssh_key
gh_cli
dotfiles
macos_rbenv
ruby
nvm
yarn
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
git
zsh
oh_my_zsh
ssh_key
windows_browser
gh_cli
dotfiles
windows_ssh
rbenv
ruby
nvm
yarn
windows_postgresql
checkup
kitt
windows_slack
slack_settings
windows_settings
conclusion].freeze
UBUNTU = %w[
intro
zoom
github
ubuntu_vscode
vscode_extensions
vscode_liveshare
git
zsh
oh_my_zsh
ssh_key
gh_cli
dotfiles
rbenv
ruby
nvm
yarn
ubuntu_postgresql
checkup
kitt
ubuntu_slack
slack_settings
ubuntu_settings
conclusion].freeze
filenames = {
'macos.md' => MACOS,
'windows.md' => WINDOWS,
'ubuntu.md' => UBUNTU
}
["", "cn"].each do |locale|
filenames.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|
folder = locale.empty? ? "_partials" : "_partials/#{locale}"
f << File.read(File.join(folder, "#{partial}.md"), encoding: "utf-8").gsub("<RUBY_VERSION>", SETUP_RUBY_VERSION)
f << "\n\n"
end
end
end
end