diff options
| author | RblSb <msrblsb@gmail.com> | 2020-06-03 14:32:02 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-06-03 14:32:02 +0300 |
| commit | 6bb620cb803a6587dcbacc4a3360cbf3d75f3064 (patch) | |
| tree | 93424d764d9922ab74617eb4793b5cc0ed6eec0d /src/server/Utils.hx | |
| parent | c1a044cf6c83dd87c81ad90ab0a4d10d2f74f67c (diff) | |
Event logs and log replay
Diffstat (limited to 'src/server/Utils.hx')
| -rw-r--r-- | src/server/Utils.hx | 5 |
1 files changed, 5 insertions, 0 deletions
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 -> { |
