Skip to content

Commit bbf7316

Browse files
committed
MISC: Clean up code for managing the packages.
BUG: Ensure absent works the same as before.
1 parent c54346d commit bbf7316

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

manifests/cli.pp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,29 @@
4545
}
4646
}
4747
elsif 'absent' == $ensure {
48-
file { "${wp::bin_path}/":
48+
file { "${wp::bin_path}/${wp::executable_filename}":
4949
ensure => absent,
5050
}
5151
file { '/usr/local/src/wp-cli':
5252
ensure => absent,
5353
}
5454
}
5555

56-
if $manage_php_package {
57-
if ! defined( Package[ $::wp::php_package ] ) {
58-
package { $::wp::php_package:
59-
ensure => installed,
60-
}
56+
if $manage_php_package and ! defined( Package[ $::wp::php_package ] ) {
57+
package { $::wp::php_package:
58+
ensure => installed,
6159
}
6260
}
6361

64-
if $manage_curl_package {
65-
if ! defined(Package['curl']) {
66-
package { 'curl':
67-
ensure => installed,
68-
}
62+
if $manage_curl_package and ! defined(Package['curl']) {
63+
package { 'curl':
64+
ensure => installed,
6965
}
7066
}
7167

72-
if $manage_git_package {
73-
if ! defined(Package['git']) {
74-
package { 'git':
75-
ensure => installed,
76-
}
68+
if $manage_git_package and ! defined(Package['git']) {
69+
package { 'git':
70+
ensure => installed,
7771
}
7872
}
7973
}

0 commit comments

Comments
 (0)