def METHOD_NAME(dir: Path, tmpdir: Path, hfs_tool: Path = None):
    "Set HFS attributes of dir to use a custom icon"
    if is_linux:
        hfs = tmpdir / "staged.hfs"
        subprocess.check_call([hfs_tool, hfs, "attr", "/", "C"])
    elif is_osx:
        subprocess.check_call(["SetFile", "-a", "C", dir])