Skip to content

Commit

Permalink
Merge pull request #221 from ghoneycutt/global_config_require_npm
Browse files Browse the repository at this point in the history
Fix ordering bug when using global_config_entry and managing npm
  • Loading branch information
jyaworski committed Apr 21, 2016
2 parents 0576605 + 15697f4 commit 50cabb4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions manifests/npm/global_config_entry.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
$value = undef,
) {

include ::nodejs

validate_re($ensure, '^(present|absent)$', "${module_name}::npm::global_config_entry : Ensure parameter must be present or absent")

case $ensure {
Expand All @@ -26,14 +28,22 @@
}
}

if $nodejs::npm_package_ensure != 'absent' {
$exec_require = "Package[${nodejs::npm_package_name}]"
} else {
$exec_require = undef
}

#Determine exec provider
$provider = $::osfamily ? {
'Windows' => 'windows',
default => 'shell',
}

exec { "npm_config ${ensure} ${title}":
command => "${npm_path} ${command}",
provider => $provider,
onlyif => $onlyif_command,
require => $exec_require,
}
}

0 comments on commit 50cabb4

Please sign in to comment.