From 6bb620cb803a6587dcbacc4a3360cbf3d75f3064 Mon Sep 17 00:00:00 2001 From: RblSb Date: Wed, 3 Jun 2020 14:32:02 +0300 Subject: Event logs and log replay --- src/server/Utils.hx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/server/Utils.hx') diff --git a/src/server/Utils.hx b/src/server/Utils.hx index abce1c0..40fa282 100644 --- a/src/server/Utils.hx +++ b/src/server/Utils.hx @@ -1,10 +1,15 @@ package server; +import sys.FileSystem; import js.node.Https; import js.node.Os; class Utils { + public static function ensureDir(path:String):Void { + if (!FileSystem.exists(path)) FileSystem.createDirectory(path); + } + public static function getGlobalIp(callback:(ip:String)->Void):Void { // untyped to skip second null argument for node < v10 Https.get(untyped "https://myexternalip.com/raw", r -> { -- cgit v1.2.3