Skip to content

Commit

Permalink
fix: getting hostname
Browse files Browse the repository at this point in the history
ref #1

Switching to the vim api to get a hostname.
  • Loading branch information
lowitea committed Dec 23, 2024
1 parent 7722816 commit 16bc4a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/aw_watcher/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
---@field aw_server AWClientConfig?
local default = {
bucket = {
hostname = nil, -- by default value of HOSTNAME env variable
hostname = nil, -- by default hostname of computer
name = nil, -- by default "aw-watcher-neovim_" .. hostname
},
aw_server = {
Expand All @@ -30,7 +30,7 @@ local function new(opts)
config.bucket = opts.bucket or default.bucket
assert(type(config.bucket) == "table", "bucket config must be a table")

config.bucket.hostname = config.bucket.hostname or os.getenv("HOSTNAME")
config.bucket.hostname = config.bucket.hostname or vim.uv.os_gethostname()
assert(type(config.bucket.hostname) == "string", "bucket hostname must be a string")

config.bucket.name = config.bucket.name or ("aw-watcher-neovim_" .. config.bucket.hostname)
Expand Down

0 comments on commit 16bc4a7

Please sign in to comment.