--!strict local process = require("@lune/process") local stdio = require("@lune/stdio") local result = require("@pkg/result") local function c_print(msg: string) stdio.write(`{stdio.color("blue")}[info]{stdio.color("reset")} {msg}\n`) end local function c_warn(msg: string) stdio.write(`{stdio.color("yellow")}[warn]{stdio.color("reset")} {msg}\n`) end local function c_error(msg: string) stdio.ewrite(`{stdio.color("red")}[error]{stdio.color("reset")} {msg}\n`) end local function c_spawn(command: string): result.Identity local args = string.split(command, " ") local program = table.remove(args, 1) if not program then return result(false, "Couldn't find program in command.") end local spawn_result = process.spawn(program, args) if not spawn_result.ok then return result(false, spawn_result.stderr) end return result(true, spawn_result) end local common = { default_name = "CSSharpTemplate", print = c_print, warn = c_warn, error = c_error, spawn = c_spawn, } export type Replicator = (dist_folder: string, remote_output: string) -> result.Identity return common