fix(ci): undefiend variabe;
This commit is contained in:
parent
793063a68e
commit
b219633fc1
2 changed files with 6 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ local M = {}
|
||||||
|
|
||||||
local cache_file = vim.fn.stdpath('data') .. '/cp-nvim.json'
|
local cache_file = vim.fn.stdpath('data') .. '/cp-nvim.json'
|
||||||
local cache_data = {}
|
local cache_data = {}
|
||||||
|
local loaded = false
|
||||||
|
|
||||||
---@param platform string
|
---@param platform string
|
||||||
---@return number?
|
---@return number?
|
||||||
|
|
|
||||||
|
|
@ -278,6 +278,11 @@ function M.run_problem(ctx, contest_config, is_debug)
|
||||||
input_data = table.concat(vim.fn.readfile(ctx.input_file), '\n') .. '\n'
|
input_data = table.concat(vim.fn.readfile(ctx.input_file), '\n') .. '\n'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local cache = require('cp.cache')
|
||||||
|
cache.load()
|
||||||
|
local timeout_ms, _ = cache.get_constraints(ctx.contest, ctx.contest_id, ctx.problem_id)
|
||||||
|
timeout_ms = timeout_ms or 2000
|
||||||
|
|
||||||
local run_cmd = build_command(language_config.test, language_config.executable, substitutions)
|
local run_cmd = build_command(language_config.test, language_config.executable, substitutions)
|
||||||
local exec_result = execute_command(run_cmd, input_data, timeout_ms)
|
local exec_result = execute_command(run_cmd, input_data, timeout_ms)
|
||||||
local formatted_output = format_output(exec_result, ctx.expected_file, is_debug)
|
local formatted_output = format_output(exec_result, ctx.expected_file, is_debug)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue