mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-19 19:01:05 +03:00
fix: simple path fix in generate.py
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -127,6 +127,12 @@ if __name__ == '__main__':
|
|||||||
options.executable = 'rustdesk.exe'
|
options.executable = 'rustdesk.exe'
|
||||||
if not options.executable.startswith(folder):
|
if not options.executable.startswith(folder):
|
||||||
options.executable = folder + '/' + options.executable
|
options.executable = folder + '/' + options.executable
|
||||||
|
# Note: the simple check `options.executable.startswith(folder)` is incorrect.
|
||||||
|
# `python generate.py -f rustdesk -e rustdesk.exe` or `python generate.py -f rustdesk`
|
||||||
|
# will result the print "Executable path: ..exe".
|
||||||
|
# So we need to check if the executable is in the folder, and if so, concat again.
|
||||||
|
if os.path.exists(os.path.join(folder, options.executable)):
|
||||||
|
options.executable = os.path.join(folder, options.executable)
|
||||||
exe: str = os.path.abspath(options.executable)
|
exe: str = os.path.abspath(options.executable)
|
||||||
if not exe.startswith(os.path.abspath(folder)):
|
if not exe.startswith(os.path.abspath(folder)):
|
||||||
print("The executable must locate in source folder")
|
print("The executable must locate in source folder")
|
||||||
|
|||||||
Reference in New Issue
Block a user