Skip to content

Commit 595b0c0

Browse files
committed
Auto sdcard_mount trailing / or \
1 parent 570fae1 commit 595b0c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

PyDuck.py

+9
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,15 @@ def cmdUseGenerate(modulename):
299299
#read the duckyscript and replace the uac key if needed
300300
global moduleAttributes
301301
ducky = moduleAttributes['sdcard_mount']
302+
suffix = "/"
303+
if os.name == 'nt':
304+
suffix = "\\"
305+
if not ducky.endswith(suffix, len(ducky)-1, len(ducky)):
306+
if os.name == 'nt':
307+
ducky = ducky + "\\"
308+
else:
309+
ducky = ducky + "/"
310+
302311
lang = moduleAttributes['language']
303312
moduleAttributes.pop('sdcard_mount', None)
304313
moduleAttributes.pop('language', None)

0 commit comments

Comments
 (0)