Skip to content

Commit b92adbf

Browse files
committed
feat(desktop): Delete update package after successful installation in MacOS and Linux
1 parent e6b4c91 commit b92adbf

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

composeApp/src/jvmMain/kotlin/com/jankinwu/fntv/client/utils/DesktopUpdateInstaller.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ object MacOSUpdateInstaller : DesktopUpdateInstaller {
238238
# 7) Launch the newly copied app
239239
echo "Launching updated app: $TARGET_PARENT/$APP_NAME"
240240
open "$TARGET_PARENT/$APP_NAME"
241+
242+
echo "Deleting update package..."
243+
rm "$DMG_FILE"
241244
242245
echo "Update script for DMG finished."
243246
""".trimIndent()
@@ -309,6 +312,9 @@ object MacOSUpdateInstaller : DesktopUpdateInstaller {
309312
echo "Launching updated app: $TARGET_PARENT/$APP_NAME"
310313
open "$TARGET_PARENT/$APP_NAME"
311314
315+
echo "Deleting update package..."
316+
rm "$ZIP_FILE"
317+
312318
echo "Update script for ZIP finished."
313319
""".trimIndent()
314320
}
@@ -397,7 +403,10 @@ object LinuxUpdateInstaller : DesktopUpdateInstaller {
397403
done
398404
399405
# Run the install command
400-
$$installCommand "$UPDATE_FILE"
406+
$installCommand "$UPDATE_FILE"
407+
408+
echo "Deleting update package..."
409+
rm "$UPDATE_FILE"
401410
""".trimIndent()
402411
}
403412

0 commit comments

Comments
 (0)