generated from marked/CSSharpTemplate
Initial commit
This commit is contained in:
commit
a44fe0dbe0
20 changed files with 1237 additions and 0 deletions
46
lune/manager/common.luau
Normal file
46
lune/manager/common.luau
Normal file
|
@ -0,0 +1,46 @@
|
|||
--!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<process.SpawnResult>
|
||||
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<nil>
|
||||
|
||||
return common
|
Loading…
Add table
Add a link
Reference in a new issue