|
25 | 25 | Integer[0] $auto_update_frequency = 14, |
26 | 26 | ) { |
27 | 27 | include ohmyzsh |
28 | | - $date_command = '$(date +\'%Y-%m-%dT%H:%M:%S%:z\')' |
29 | 28 |
|
30 | 29 | if !defined(Package['git']) { |
31 | 30 | package { 'git': |
|
76 | 75 | user => $name, |
77 | 76 | require => Package['git'], |
78 | 77 | } |
79 | | - -> if $update_zshrc == sync { |
80 | | - if $backup_zshrc { |
81 | | - exec { "backup .zshrc ${name}": |
82 | | - command => "cp ${home}/.zshrc ${home}/.zshrc.bak.${date_command}", |
83 | | - path => ['/bin', '/usr/bin'], |
84 | | - onlyif => "test -f ${home}/.zshrc", |
85 | | - user => $name, |
86 | | - before => [ |
87 | | - File_Line["ohmyzsh::auto_update_frequency - ${name}"], |
88 | | - ], |
89 | | - subscribe => Vcsrepo["${home}/.oh-my-zsh"], |
90 | | - refreshonly => true, |
91 | | - } |
92 | | - } |
93 | | - -> exec { "ohmyzsh::cp .zshrc ${name}": |
94 | | - command => "cp ${home}/.oh-my-zsh/templates/zshrc.zsh-template ${home}/.zshrc", |
95 | | - path => ['/bin', '/usr/bin'], |
96 | | - user => $name, |
97 | | - before => [ |
98 | | - File_Line["ohmyzsh::auto_update_frequency - ${name}"], |
99 | | - ], |
100 | | - subscribe => Vcsrepo["${home}/.oh-my-zsh"], |
101 | | - refreshonly => true, |
102 | | - } |
103 | | - } elsif $update_zshrc == disabled { |
104 | | - exec { "ohmyzsh::cp .zshrc ${name}": |
105 | | - creates => "${home}/.zshrc", |
106 | | - command => "cp ${home}/.oh-my-zsh/templates/zshrc.zsh-template ${home}/.zshrc", |
107 | | - path => ['/bin', '/usr/bin'], |
108 | | - onlyif => "getent passwd ${name} | cut -d : -f 6 | xargs test -e", |
109 | | - user => $name, |
110 | | - } |
111 | | - } elsif $update_zshrc == always { |
112 | | - if $backup_zshrc { |
113 | | - exec { "backup .zshrc ${name}": |
114 | | - command => "cp ${home}/.zshrc ${home}/.zshrc.bak.${date_command}", |
115 | | - path => ['/bin', '/usr/bin'], |
116 | | - onlyif => "test -f ${home}/.zshrc", |
117 | | - user => $name, |
118 | | - } |
119 | | - } |
120 | | - -> exec { "ohmyzsh::cp .zshrc ${name}": |
121 | | - command => "cp ${home}/.oh-my-zsh/templates/zshrc.zsh-template ${home}/.zshrc", |
122 | | - path => ['/bin', '/usr/bin'], |
123 | | - user => $name, |
124 | | - } |
125 | | - } |
126 | | - -> file_line { "ohmyzsh::auto_update_frequency - ${name}": |
127 | | - path => "${home}/.zshrc", |
128 | | - line => "zstyle ':omz:update' frequency ${auto_update_frequency}", |
129 | | - match => '.*zstyle\ \':omz:update\'\ frequency .*', |
130 | | - } |
131 | | - -> if $auto_update_mode == disabled { |
132 | | - file_line { "enable ohmyzsh::auto_update_mode disabled - ${name}": |
133 | | - path => "${home}/.zshrc", |
134 | | - line => "zstyle ':omz:update' mode disabled", |
135 | | - match => '.*zstyle\ \':omz:update\'\ mode\ disabled.*', |
| 78 | + -> unless $ohmyzsh::concat { |
| 79 | + ohmyzsh::install::classic { $name: |
| 80 | + update_zshrc => $update_zshrc, |
| 81 | + backup_zshrc => $backup_zshrc, |
| 82 | + auto_update_mode => $auto_update_mode, |
| 83 | + auto_update_frequency => $auto_update_frequency, |
| 84 | + home => $home, |
| 85 | + group => $group, |
136 | 86 | } |
137 | | - file_line { "disable ohmyzsh::auto_update_mode auto - ${name}": |
138 | | - path => "${home}/.zshrc", |
139 | | - line => "# zstyle ':omz:update' mode auto", |
140 | | - match => '.*zstyle\ \':omz:update\'\ mode\ auto.*', |
141 | | - } |
142 | | - file_line { "disable ohmyzsh::auto_update_mode reminder - ${name}": |
143 | | - path => "${home}/.zshrc", |
144 | | - line => "# zstyle ':omz:update' mode reminder", |
145 | | - match => '.*zstyle\ \':omz:update\'\ mode\ reminder.*', |
146 | | - } |
147 | | - } elsif $auto_update_mode == auto { |
148 | | - file_line { "enable ohmyzsh::auto_update_mode auto - ${name}": |
149 | | - path => "${home}/.zshrc", |
150 | | - line => "zstyle ':omz:update' mode auto", |
151 | | - match => '.*zstyle\ \':omz:update\'\ mode\ auto.*', |
152 | | - } |
153 | | - file_line { "disable ohmyzsh::auto_update_mode disabled - ${name}": |
154 | | - path => "${home}/.zshrc", |
155 | | - line => "# zstyle ':omz:update' mode disabled", |
156 | | - match => '.*zstyle\ \':omz:update\'\ mode\ disabled.*', |
157 | | - } |
158 | | - file_line { "disable ohmyzsh::auto_update_mode reminder - ${name}": |
159 | | - path => "${home}/.zshrc", |
160 | | - line => "# zstyle ':omz:update' mode reminder", |
161 | | - match => '.*zstyle\ \':omz:update\'\ mode\ reminder.*', |
162 | | - } |
163 | | - } elsif $auto_update_mode == reminder { |
164 | | - file_line { "enable ohmyzsh::auto_update_mode reminder - ${name}": |
165 | | - path => "${home}/.zshrc", |
166 | | - line => "zstyle ':omz:update' mode reminder", |
167 | | - match => '.*zstyle\ \':omz:update\'\ mode\ reminder.*', |
168 | | - } |
169 | | - file_line { "disable ohmyzsh::auto_update_mode auto - ${name}": |
170 | | - path => "${home}/.zshrc", |
171 | | - line => "# zstyle ':omz:update' mode auto", |
172 | | - match => '.*zstyle\ \':omz:update\'\ mode\ auto.*', |
173 | | - } |
174 | | - file_line { "disable ohmyzsh::auto_update_mode disabled - ${name}": |
175 | | - path => "${home}/.zshrc", |
176 | | - line => "# zstyle ':omz:update' mode disabled", |
177 | | - match => '.*zstyle\ \':omz:update\'\ mode\ disabled.*', |
| 87 | + } else { |
| 88 | + ohmyzsh::install::concat { $name: |
| 89 | + auto_update_mode => $auto_update_mode, |
| 90 | + auto_update_frequency => $auto_update_frequency, |
| 91 | + home => $home, |
| 92 | + group => $group, |
178 | 93 | } |
179 | 94 | } |
180 | 95 | # Fix permissions on '~/.oh-my-zsh/cache/completions' |
|
0 commit comments