fix(scan): ignore wp-cli stderr messages (#825) (#915)

This commit is contained in:
Shigechika AIKAWA
2019-11-01 10:01:50 +09:00
committed by Kota Kanbe
parent 45bff26558
commit bd7e61d7cc

View File

@@ -670,7 +670,7 @@ func (l *base) detectWpCore() (string, error) {
}
func (l *base) detectWpThemes() ([]models.WpPackage, error) {
cmd := fmt.Sprintf("sudo -u %s -i -- %s theme list --path=%s --format=json --allow-root",
cmd := fmt.Sprintf("sudo -u %s -i -- %s theme list --path=%s --format=json --allow-root 2>/dev/null",
l.ServerInfo.WordPress.OSUser,
l.ServerInfo.WordPress.CmdPath,
l.ServerInfo.WordPress.DocRoot)
@@ -691,7 +691,7 @@ func (l *base) detectWpThemes() ([]models.WpPackage, error) {
}
func (l *base) detectWpPlugins() ([]models.WpPackage, error) {
cmd := fmt.Sprintf("sudo -u %s -i -- %s plugin list --path=%s --format=json --allow-root",
cmd := fmt.Sprintf("sudo -u %s -i -- %s plugin list --path=%s --format=json --allow-root 2>/dev/null",
l.ServerInfo.WordPress.OSUser,
l.ServerInfo.WordPress.CmdPath,
l.ServerInfo.WordPress.DocRoot)