From: Alexis Laferrière Date: Wed, 7 Oct 2015 15:38:34 +0000 (-0400) Subject: lib: move assets_dir X-Git-Tag: v0.8~32^2~4 X-Git-Url: http://nitlanguage.org lib: move assets_dir Signed-off-by: Alexis Laferrière --- 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}"