[ZeroBrane Studio] Re: New beta version of ZeroBrane Studio is available

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Fri, 1 Nov 2019 11:11:13 -0700

Hi Ulrich,

and proj2 is the project zbs opens autmatically. running my proj2 uses
the love exe 11.2 - ok. If i switch the project to proj1 and run it, is
uses love.exe from 11.2 because i ran this love.exe before.(wrong)

Ok, thank you for the explanation; try the following patch:

diff --git a/interpreters/love2d.lua b/interpreters/love2d.lua
index 0b9c4a06..f43ff989 100644
--- a/interpreters/love2d.lua
+++ b/interpreters/love2d.lua
@@ -9,8 +9,12 @@ return {
   description = "L<C3><96>VE game engine",
   api = {"baselib", "love2d"},
   frun = function(self,wfilename,rundebug)
-    local love2d = ide.config.path.love2d or pathcache -- check if
the path is configured
     local projdir = self:fworkdir(wfilename)
+    local love2d = ide.config.path.love2d or pathcache and pathcache[projdir]
+    if love2d and not wx.wxFileExists(love2d) then
+      ide:Print(("Can't find configured love2d executable:
'%s'."):format(love2d))
+      love2d = nil
+    end
     if not love2d then
       local sep = win and ';' or ':'
       local default =
@@ -31,7 +35,8 @@ return {
           ..table.concat(paths, ", "))
         return
       end
-      pathcache = love2d
+      pathcache = pathcache or {}
+      pathcache[projdir] = love2d
     end

     if not GetFullPathIfExists(projdir, 'main.lua') then

I forgot to mention there is no love.exe in the windows search path.

I'm also thinking that it may sense to check "local" folder before
default and PATH locations are checked, so that any local instal will
take precedence over system-wide one when both are present.

Paul.

On Fri, Nov 1, 2019 at 10:58 AM Ulrich Schmidt <u.sch.zw@xxxxxx> wrote:


Am 01.11.2019 um 18:44 schrieb Paul K:
Hi Ulrich,

I suggest to "forget"
about the used löve executable after each run and start a new exe search
each time i run my project.
Thank you for the feedback! How would it help if it would find the
same executable on the next search? If you removed/renamed the
directory it found during the first run (so the executable is no
longer present), then it would make sense to start the search anew. Is
that what you'd want? I can definitely update the interpreter code to
work that way.

Paul.

ok imagine the following directory structure on windows:

/projects/
     love/
       10.1/
       11.1/
         proj1/
       11.2/
         proj2/

The different love exe are stored (permanently) in the folders 10.1,
11.1 and 11.2 and i open and run proj1 in zbs. zbs find the love.exe in
11.1. Then i switch my project in zbs to proj2 and run it. zbs uses the
already found love.exe in 11.1 instead the one in 11.2. I restart zbs
and proj2 is the project zbs opens autmatically. running my proj2 uses
the love exe 11.2 - ok. If i switch the project to proj1 and run it, is
uses love.exe from 11.2 because i ran this love.exe before.(wrong)






Other related posts: