Skip to content

Commit f1f3876

Browse files
committed
change install dir
1 parent 8debcdb commit f1f3876

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ Install clang-tools binaries (clang-format, clang-tidy) with pip.
1010
Install `clang-tools` command with pip
1111

1212
```bash
13+
# install `clang-tools` from pip
1314
$ pip install clang-tools
15+
16+
# install `clang-tools` from git repo
17+
pip install git+https://github.com/shenxianpeng/clang-tools-pip.git@main
1418
```
1519

1620
## Usage

clang_tools/install.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,19 @@ def move_and_chmod_binary(old_file_name, new_file_name, directory) -> None:
6767
if directory:
6868
install_dir = directory
6969
else:
70-
install_dir = os.path.dirname(sys.executable)
70+
os = check_install_os()
71+
if os == "windows":
72+
install_dir = os.path.dirname(sys.executable)
73+
else:
74+
install_dir = os.path.expanduser('~/.local/bin/')
7175
try:
7276
if not os.path.isdir(install_dir):
7377
os.makedirs(install_dir)
7478
shutil.move(old_file_name, f"{install_dir}/{new_file_name}")
7579
os.chmod(os.path.join(install_dir, new_file_name), 0o755)
7680
except PermissionError:
7781
raise SystemExit(
78-
f"Don't have permission to install {new_file_name} to {install_dir}. \
79-
Try to run with the appropriate permissions."
82+
f"Don't have permission to install {new_file_name} to {install_dir}. Try to run with the appropriate permissions."
8083
)
8184

8285

0 commit comments

Comments
 (0)