Skip to content

Commit 65eb1ec

Browse files
committed
fix: report cli download progress with the real name
1 parent 3856d57 commit 65eb1ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/com/coder/toolbox/cli/downloader/CoderDownloadService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ class CoderDownloadService(
141141
val buffer = ByteArray(DEFAULT_BUFFER_SIZE)
142142
var bytesRead: Int
143143
var totalRead = 0L
144-
// caching this because the settings store recomputes it every time
145-
val binaryName = localPath.name
144+
// local path is a temporary filename, reporting the progress with the real name
145+
val binaryName = localPath.name.removeSuffix(".tmp")
146146
sourceStream.use { source ->
147147
outputStream.use { sink ->
148148
while (source.read(buffer).also { bytesRead = it } != -1) {

0 commit comments

Comments
 (0)