local wezterm = require("wezterm")

local M = {}

local function is_found(str, pattern)
	return string.find(str, pattern) ~= nil
end

function M.platform()
	local is_win = is_found(wezterm.target_triple, "windows")
	local is_linux = is_found(wezterm.target_triple, "linux")
	local is_mac = is_found(wezterm.target_triple, "darwin")
	local os = is_win and "windows" or is_linux and "linux" or is_mac and "mac" or "unknown"
	return {
		os = os,
		is_win = is_win,
		is_linux = is_linux,
		is_mac = is_mac,
	}
end

return M
