Skip to content

Commit

Permalink
Object 116
Browse files Browse the repository at this point in the history
  • Loading branch information
luozhiya committed Jan 6, 2025
1 parent 862a632 commit 6ed82a5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
1 change: 1 addition & 0 deletions lua/fittencode/compression/gzip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function M.compress(format, input, options)
local fw = assert(vim.uv.fs_open(gz, 'r', 438))
local content = vim.uv.fs_read(fw, -1)
vim.uv.fs_close(fw)
vim.uv.fs_unlink(gz)
Fn.schedule_call(options.on_once, content)
else
Fn.schedule_call(options.on_error)
Expand Down
31 changes: 11 additions & 20 deletions lua/fittencode/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,11 @@ local defaults = {
level = vim.log.levels.WARN,
},
hash = {
sm3 = {
-- SM3 hash
-- Avaiable options:
-- * 'gmssl'
-- * 'cc'
backend = 'md5sum',
gmssl = {
-- Default `gmssl`
command = '',
}
},
md5 = {
-- MD5 hash
-- Avaiable options:
-- * 'md5sum'
-- * 'cc'
-- * 'hash'
backend = 'md5sum',
md5sum = {
-- Default `md5sum`
Expand All @@ -196,20 +185,22 @@ local defaults = {
}
},
compress = {
-- Avaiable options:
-- * 'gzip'
-- * 'zlib' (Only available on Linux)
backend = 'gzip',
gzip = {
-- Default `gzip`
command = '',
},
-- Avaiable options:
-- * 'gzip'
-- * 'zlib' (Only available on Linux)
backend = 'gzip',
gzip = {
-- Default `gzip`
command = '',
},
}
},
http = {
-- Avaiable options:
-- * 'curl'
-- * 'libcurl' (Only available on Linux)
backend = 'libcurl',
backend = 'curl',
-- 0 (zero) which means request never times out during transfer
timeout = 600, -- seconds
curl = {
Expand Down
2 changes: 1 addition & 1 deletion lua/fittencode/http/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local M = {}
---@param options? FittenCode.HTTP.Request
function M.fetch(url, options)
local fetch
if Config.http.backend == 'libcurl' and Fn.is_linux() then
if Config.http.backend == 'libcurl' then
fetch = require('fittencode.http.libcurl').fetch
else
fetch = require('fittencode.http.curl').fetch
Expand Down

0 comments on commit 6ed82a5

Please sign in to comment.