1
0

coditionally require dbg

This commit is contained in:
Rokas Puzonas 2022-09-03 21:20:46 +00:00
parent 7ae6f135fa
commit 4220de5f10
3 changed files with 10 additions and 4 deletions

View File

@ -1,7 +1,9 @@
{ {
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.runtime.version": "LuaJIT",
"Lua.diagnostics.disable": [ "Lua.diagnostics.disable": [
"undefined-field" "undefined-field",
"need-check-nil"
], ],
"Lua.workspace.library": { "Lua.workspace.library": {
"../cc-lsp-config": true "../cc-lsp-config": true

View File

@ -1,4 +1,3 @@
local dbg_file local dbg_file
function dbg(...) function dbg(...)
if dbg_file then if dbg_file then

View File

@ -1,6 +1,11 @@
local ui = require("ui") local ui = require("ui")
require("dbg")("logs.txt") do
local success, dbg_module = pcall(require, "dbg")
if success then
dbg_module("logs.txt")
end
end
local function is_inventory(peripheral_name) local function is_inventory(peripheral_name)
local types = {peripheral.getType(peripheral_name)} local types = {peripheral.getType(peripheral_name)}