aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-03-28 19:03:45 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-03-28 19:03:45 -0400
commit126735cc21e63888fd769f29f5bcc41e3b81e30c (patch)
treef2e48b83d0fcd1eb79f7d988e1d6f87c49093340 /src/lpm.lua
parent5a05b1a883c932b539fe905f6bab5b1962601c97 (diff)
downloadlite-xl-plugin-manager-126735cc21e63888fd769f29f5bcc41e3b81e30c.tar.gz
lite-xl-plugin-manager-126735cc21e63888fd769f29f5bcc41e3b81e30c.zip
Suppress the progress bar by default, if we're not connected on a TTY.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index c2e829c..9a41848 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -1950,7 +1950,7 @@ not commonly used publically.
TMPDIR = common.normalize_path(ARGS["tmpdir"]) or CACHEDIR .. PATHSEP .. "tmp"
if ARGS["trace"] then system.trace(true) end
- if (not JSON and not QUIET) or (JSON and PROGRESS) then
+ if (not JSON and not QUIET and (TTY or PROGRESS)) or (JSON and PROGRESS) then
local start_time, last_read
local function format_bytes(bytes)
if bytes < 1024 then return string.format("%6d B", math.floor(bytes)) end
@@ -1959,7 +1959,6 @@ not commonly used publically.
return string.format("%6.2f GB", bytes / (1024*1024*1024))
end
if JSON then
-
write_progress_bar = function(total_read, total_objects_or_content_length, indexed_objects, received_objects, local_objects, local_deltas, indexed_deltas)
if type(total_read) == "boolean" then
io.stdout:write(json.encode({ progress = { percent = 1, label = progress_bar_label } }) .. "\n")