From 3a493e18633884e56bb255b71082d44a36c32902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Wed, 5 Dec 2018 19:18:07 +0100 Subject: [PATCH] Update to LuaRocks 3 --- src/utils.lua | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/utils.lua b/src/utils.lua index f31c63a..845d729 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -1,11 +1,14 @@ --- Provides utility functions and constants. -- @module utils -local cfg = require 'luarocks.cfg' +local cfg = require 'luarocks.core.cfg' local fs = require 'luarocks.fs' +local dir = require 'luarocks.dir' local utils = {} +assert(cfg.init()) +fs.init() --[[ CACHE ]]-- @@ -13,15 +16,9 @@ local utils = {} utils.cache = nil do - local cache - if cfg.platforms.windows then - cache = os.getenv("APPDATA") - else - cache = os.getenv("HOME").."/.cache" - end - cache = fs.absolute_name(cache.."/love-release") - assert(fs.make_dir(cache)) - utils.cache = cache + local cache = dir.dir_name(cfg.local_cache) .. "/love-release" + assert(fs.make_dir(cache)) + utils.cache = cache end