Skip to content

Commit f899dce

Browse files
author
Mohamed Karrab
committed
Command arguments bug fixed, 1.4.6
1 parent 4ae19d5 commit f899dce

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ w_mod.log
66
OUTPUT
77
__pycache__
88
.idea
9-
src/tests.txt
9+
src/tests.txt
10+
notes.md

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ktool
2-
ktool 1.4.5 Copyright (c) 2023 by Mohamed Karrab
2+
ktool 1.4.6 Copyright (c) 2023 by Mohamed Karrab
33

44
## Disclaimer:
55
```

setup.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
31
import os
42
import shutil
53

@@ -8,6 +6,15 @@
86

97

108
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+
1118
try:
1219
print('[+] Installing ktool to {}...'.format(KTOOL_DIR))
1320
shutil.copytree('.', KTOOL_DIR)
@@ -18,13 +25,12 @@ def install_ktool():
1825
try:
1926
with open(os.path.join(BIN_DIR, 'ktool'), 'w') as f:
2027
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')))
2229
os.chmod(os.path.join(BIN_DIR, 'ktool'), 0o755)
2330
except Exception as e:
2431
print('[-] Error :', e)
2532
return
2633

2734
print('[+] Ktool installed successfully!')
2835

29-
3036
install_ktool()

0 commit comments

Comments
 (0)