Skip to content

Commit 173e3d1

Browse files
LightWayUpayasa520
authored andcommitted
Fix bindfs invocation when mounting shared folders
When passing sequence of arguments to `subprocess.run`, each argument needs to be separate. Commit 18d4edd fixed mounting when using FUSE >= 3.x, but instead caused regression for older versions of FUSE. Fixes #19
1 parent 72a441f commit 173e3d1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

waydroid_helper/tools/mount_service.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ def BindMount(self, source, target):
3838
text=True,
3939
)
4040
fuse_version = fuse_version_result.stdout.splitlines()[0].split()[4]
41-
if int(fuse_version.split('.')[0]) < 3:
42-
nonempty_option = "-o nonempty"
43-
else:
44-
nonempty_option = ""
4541

4642
command = [
4743
"bindfs",
@@ -52,8 +48,11 @@ def BindMount(self, source, target):
5248
source_str,
5349
target_str,
5450
]
55-
if nonempty_option:
56-
command.insert(1, nonempty_option)
51+
if int(fuse_version.split('.')[0]) < 3:
52+
command[1:1] = [
53+
"-o",
54+
"nonempty"
55+
]
5756

5857
result = subprocess.run(
5958
command,

0 commit comments

Comments
 (0)