Dear Bridger,
Sorry for letting you wait; I’ve been on vacation.
I have opened a new GitHub issue [1], and I will soon check if it’s
possible to modify or extend path resolution of the RUN command.
All the best,
Christian
[1] https://github.com/BaseXdb/basex/issues/1454
On Fri, Apr 28, 2017 at 4:13 AM, Bridger Dyson-Smith
<bdysonsmith@gmail.com> wrote:
> Hi all --
>
> apologies for the strange title: I'm not quite sure how to word my question.
> I'm having a problem with maintaining the correct context of basexgui,
> particularly with testing some .bxs files.
>
> I have a directory where I've been keeping my BaseX installs:
> /usr/home/bridger/src/basex = $baseXhome.
>
> I've been in the habit of starting new tests and projects in the repo
> directory in $baseXhome; e.g. $baseXhome/repo/new-test. In the new-test
> directory, I have the following:
>
> new-test/
> data/
> resources/
> add.xq
> .basex
> .basexgui
> .basexhome
> check.bxs
> add.bxs
>
> check.bxs is a simple script:
> CHECK foo
> RUN add.bxs
> CLOSE
>
> add.bxs runs an xquery script:
> RUN resources/add.xq
>
> and the `add.xq` is (surprisingly) another simple script:
> let $msg := file:current-dir()
> return
> $msg
>
> The problem I'm having is that, unless I `cd ~/src/basex/repo/new-test &&
> basexgui`, `basexgui` isn't able to determine the relative file path(s) of
> any of the secondary scripts (add.bxs and resources/add.xq). While it
> wouldn't be a terrible burden to launch the GUI from a new terminal (thank
> heavens for multiplexers!), the problem there is that basexgui seems to
> default to (re)opening the last directory where it was launched; in other
> words
> 1. `cd ~/src/basex/repo/new-test && basexgui` and the GUI launches and
> things look great.
> 2. in a new terminal window: `cd ~/src/basex/repo/old-test && basexgui` and
> the GUI launches and opens the new-test directory.
>
> So, I guess that's two problems, but they're both somewhat related to the
> relative directory path context of the GUI.
>
> I've tried adding .basexhome (manually) and .basexgui (manually and letting
> the GUI add them automatically), but those files don't seem to help matters.
> Is there anything else that I can try to resolve this? I know that I can use
> absolute file paths, but I have a simple project that I want to share with a
> colleague. Is the solution to add some XQuery that will determine file
> paths, and add/insert that into the command .bxs files?
>
> Thanks so much for your time and trouble.
> Best,
> Bridger
>
>
>
>
>
>
>
>