From 2c68ea2e91f8775987a033a4401cdfea249725d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Wed, 7 Oct 2015 11:38:34 -0400 Subject: [PATCH] lib: move assets_dir MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/linux/linux.nit | 6 ++++++ lib/mnit/linux/linux_assets.nit | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/linux/linux.nit b/lib/linux/linux.nit index 04a0c5d..a861593 100644 --- a/lib/linux/linux.nit +++ b/lib/linux/linux.nit @@ -20,6 +20,12 @@ module linux import app redef class App + # Path to the expected location of the asset folder of this program + # + # The asset folder should be located relative to the executable at `../assets/`. + # This value can be redefined to change the expected location. + var assets_dir: String = sys.program_name.dirname / "../assets/" is lazy + redef fun setup do super diff --git a/lib/mnit/linux/linux_assets.nit b/lib/mnit/linux/linux_assets.nit index 393b77d..b61d234 100644 --- a/lib/mnit/linux/linux_assets.nit +++ b/lib/mnit/linux/linux_assets.nit @@ -20,15 +20,6 @@ import mnit import linux_app redef class App - var assets_dir: String - - redef fun setup - do - assets_dir = sys.program_name.dirname + "/../assets/" - - super - end - redef fun try_loading_asset( id ) do var path = "{assets_dir}/{id}" -- 1.7.9.5