coditionally require dbg
This commit is contained in:
parent
7ae6f135fa
commit
4220de5f10
@ -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
|
||||||
|
1
dbg.lua
1
dbg.lua
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
local dbg_file
|
local dbg_file
|
||||||
function dbg(...)
|
function dbg(...)
|
||||||
if dbg_file then
|
if dbg_file then
|
||||||
|
7
main.lua
7
main.lua
@ -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)}
|
||||||
|
Loading…
Reference in New Issue
Block a user