Skip to content

Commit

Permalink
fix: support uninstall all clang-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxianpeng committed Aug 12, 2024
1 parent 7d78b27 commit 554ac53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions clang_tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def uninstall_tool(tool_name: str, version: str, directory: str):
symlink.unlink()


def uninstall_clang_tools(version: str, directory: str):
def uninstall_clang_tools(version: str, tools: str, directory: str):
"""Uninstall a clang tool of a given version.
:param version: The version of the clang-tools to remove.
Expand All @@ -243,7 +243,7 @@ def uninstall_clang_tools(version: str, directory: str):
"""
install_dir = install_dir_name(directory)
print(f"Uninstalling version {version} from {str(install_dir)}")
for tool in ("clang-format", "clang-tidy"):
for tool in tools:
uninstall_tool(tool, version, install_dir)


Expand Down
2 changes: 1 addition & 1 deletion clang_tools/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def main():
args = parser.parse_args()

if args.uninstall:
uninstall_clang_tools(args.uninstall, args.directory)
uninstall_clang_tools(args.uninstall, args.tool, args.directory)
elif args.install:
version = Version(args.install)
if version.info != (0, 0, 0):
Expand Down

0 comments on commit 554ac53

Please sign in to comment.