File tree 3 files changed +13
-6
lines changed
3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,5 @@ w_mod.log
6
6
OUTPUT
7
7
__pycache__
8
8
.idea
9
- src /tests.txt
9
+ src /tests.txt
10
+ notes.md
Original file line number Diff line number Diff line change 1
1
# ktool
2
- ktool 1.4.5 Copyright (c) 2023 by Mohamed Karrab
2
+ ktool 1.4.6 Copyright (c) 2023 by Mohamed Karrab
3
3
4
4
## Disclaimer:
5
5
```
Original file line number Diff line number Diff line change 1
- #!/usr/bin/env python3
2
-
3
1
import os
4
2
import shutil
5
3
8
6
9
7
10
8
def install_ktool ():
9
+ try :
10
+ print ('[+] Removing existing ktool directory at {}...' .format (KTOOL_DIR ))
11
+ shutil .rmtree (KTOOL_DIR )
12
+ except FileNotFoundError :
13
+ pass # If the directory doesn't exist, continue
14
+ except Exception as e :
15
+ print ('[-] Error removing existing ktool directory:' , e )
16
+ return
17
+
11
18
try :
12
19
print ('[+] Installing ktool to {}...' .format (KTOOL_DIR ))
13
20
shutil .copytree ('.' , KTOOL_DIR )
@@ -18,13 +25,12 @@ def install_ktool():
18
25
try :
19
26
with open (os .path .join (BIN_DIR , 'ktool' ), 'w' ) as f :
20
27
f .write ('#!/bin/sh\n ' )
21
- f .write ('python3 {}\n ' .format (os .path .join (KTOOL_DIR , 'src' , 'ktool.py' )))
28
+ f .write ('python3 {} "$@" \n ' .format (os .path .join (KTOOL_DIR , 'src' , 'ktool.py' )))
22
29
os .chmod (os .path .join (BIN_DIR , 'ktool' ), 0o755 )
23
30
except Exception as e :
24
31
print ('[-] Error :' , e )
25
32
return
26
33
27
34
print ('[+] Ktool installed successfully!' )
28
35
29
-
30
36
install_ktool ()
You can’t perform that action at this time.
0 commit comments