From 38457cfbbc69bfb3f57ccf41130db0ee5b88a501 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Thu, 13 Jun 2024 20:34:39 -0400 Subject: [PATCH] enforce pocket computer requirement --- pocket/startup.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pocket/startup.lua b/pocket/startup.lua index 0c08061..6ce61a2 100644 --- a/pocket/startup.lua +++ b/pocket/startup.lua @@ -2,6 +2,9 @@ -- SCADA System Access on a Pocket Computer -- +---@diagnostic disable-next-line: undefined-global +local _is_pocket_env = pocket or periphemu + require("/initenv").init_env() local crash = require("scada-common.crash") @@ -22,6 +25,12 @@ local POCKET_VERSION = "v0.10.0-alpha" local println = util.println local println_ts = util.println_ts +-- check environment (allows Pocket or CraftOS-PC) +if not _is_pocket_env then + println("You can only use this application on a pocket computer.") + return +end + ---------------------------------------- -- get configuration ----------------------------------------