Skip to content

Commit fc87a9f

Browse files
committed
ejecting 2 times on windows to correctly disconnect volume
1 parent 95eb088 commit fc87a9f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/sd_card.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,15 @@ def eject_sd(sd_device, sd_select, sd_dropdown, terminal):
128128
text=True,
129129
creationflags=subprocess.CREATE_NO_WINDOW
130130
)
131-
131+
132+
# do it 2 times to fully disconnect volume (like E:)
133+
result = subprocess.run(
134+
["powershell", "-Command", script],
135+
capture_output=True,
136+
text=True,
137+
creationflags=subprocess.CREATE_NO_WINDOW
138+
)
139+
132140
if result.returncode == 0:
133141
terminal.message(f"{drive_letter} successfully ejected.")
134142
else:

0 commit comments

Comments
 (0)