|
17 | 17 | if $config_setting =~ /(_|:_)/ {
|
18 | 18 | $onlyif_command = $facts['os']['family'] ? {
|
19 | 19 | 'Windows' => "${cmd_exe_path} /C FOR /F %G IN ('${npm_path} config get globalconfig') DO IF EXIST %G (FINDSTR /B /C:\"${$config_setting}\" %G) ELSE (EXIT 1)",
|
20 |
| - default => "test -f $(${npm_path} config get globalconfig) && grep -qe \"^${$config_setting}\" $(${npm_path} config get globalconfig)", |
| 20 | + default => "test -f \"$(${npm_path} config get globalconfig)\" && grep -qe '^${$config_setting}' \"$(${npm_path} config get globalconfig)\"", |
21 | 21 | }
|
22 | 22 | }
|
23 | 23 | else {
|
24 | 24 | $onlyif_command = $facts['os']['family'] ? {
|
25 | 25 | 'Windows' => "${cmd_exe_path} /C ${npm_path} get --global| FINDSTR /B \"${config_setting}\"",
|
26 |
| - default => "${npm_path} get --global | grep -e \"^${config_setting}\"", |
| 26 | + default => "${npm_path} get --global | grep -e '^${config_setting}'", |
27 | 27 | }
|
28 | 28 | }
|
29 | 29 | }
|
|
35 | 35 | if $config_setting =~ /(_|:_)/ {
|
36 | 36 | $onlyif_command = $facts['os']['family'] ? {
|
37 | 37 | 'Windows' => "${cmd_exe_path} /V /C FOR /F %G IN ('${npm_path} config get globalconfig') DO IF EXIST %G (FINDSTR /B /C:\"${$config_setting}=\\\"${$value}\\\"\" %G & IF !ERRORLEVEL! EQU 0 ( EXIT 1 ) ELSE ( EXIT 0 )) ELSE ( EXIT 0 )",
|
38 |
| - default => "! test -f $(${npm_path} config get globalconfig) || ! grep -qe '^${$config_setting}=\"\\?${$value}\"\\?$' $(${npm_path} config get globalconfig)", |
| 38 | + default => "! test -f \"$(${npm_path} config get globalconfig)\" || ! grep -qe '^${$config_setting}=\"\\?${$value}\"\\?$' \"$(${npm_path} config get globalconfig)\"", |
39 | 39 | }
|
40 | 40 | }
|
41 | 41 | else {
|
42 | 42 | $onlyif_command = $facts['os']['family'] ? {
|
43 | 43 | 'Windows' => "${cmd_exe_path} /C FOR /F %i IN ('${npm_path} get ${config_setting} --global') DO IF \"%i\" NEQ \"${value}\" ( EXIT 0 ) ELSE ( EXIT 1 )",
|
44 |
| - default => "test \"$(${npm_path} get ${config_setting} --global | tr -d '\n')\" != \"${value}\"", |
| 44 | + default => "test \"$(${npm_path} get ${config_setting} --global | tr -d '\n')\" != '${value}'", |
45 | 45 | }
|
46 | 46 | }
|
47 | 47 | }
|
|
0 commit comments