Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion unused_deps/unused_deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,10 @@ func printCommands(label string, deps map[string]bool) (anyCommandPrinted bool)
fmt.Printf("buildozer 'move deps runtime_deps %s' %s\n", str.Value, label)
} else {
// add dep's exported dependencies to label before removing dep
fmt.Printf("buildozer \"add deps $(%s query 'labels(exports, %s)' | tr '\\n' ' ')\" %s\n", *buildTool, str.Value, label)
fmt.Printf(
"deps=$(%s query 'labels(exports, %s)' | tr '\\n' ' '); [ -n \"$deps\" ] && buildozer \"add deps $deps\" %s\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT but we might have to roll it back if some tools analyze the output and rely on the buildozer add deps prefix to automatically run it.

*buildTool, str.Value, label,
)
fmt.Printf("buildozer 'remove deps %s' %s\n", str.Value, label)
}
anyCommandPrinted = true
Expand Down