[Geany-Users] running cmd from build

Lex Trotman elextr at xxxxx
Wed May 23 03:33:53 UTC 2018


On 23 May 2018 at 12:54, Joe McCarron via Users <users at lists.geany.org> wrote:
>
>
>
> On Tuesday, May 22, 2018, 10:44:45 PM EDT, Lex Trotman <elextr at gmail.com>
> wrote:
>
>
> Lets go back to absolute basics, which file are you editing with
> Geany? the pythonbuild.py file or the .ino file? Is the pythonbuild.py
> file a tool you are trying to run that processes the .ino file?
> Yes,
> The pythonbuild.py file is the tool. The file i am working on in Geany is
> the *.ino file.
> So, the working dir is based on the *.ino file as that is opened in Geany
> and the py
> file is not.
>

Ok, that removes some confusion.

So the command is `python /home/joe/pythonbuild.py %f`  and nothing in
the working directory column of the 'Set Build Commands' dialog.

What that does is it makes the tool part (the `python
/home/joe/pythonbuild.py` part) absolute, so it doesn't depend on
where it is run, and Geany will substitute the %f with the currently
open filename and run the command in that file's directory.

Thats the normal way Geany is intended to be set up, commands are
absolute (or found by PATH as python is) and the command is run local
to the file you are editing.  Since Geany will save the current file
when you invoke a build command that makes it all "just work" :)

Cheers
Lex

> Cheers
> Lex
>
> On 23 May 2018 at 12:01, Joe McCarron via Users <users at lists.geany.org>
> wrote:
>>
>>
>> On Tuesday, May 22, 2018, 9:34:41 PM EDT, Lex Trotman <elextr at gmail.com>
>> wrote:
>> pythonbuild.py  is in /home/joe
>>
>>
>>
>> What directory is 'pythonbuild.py' located in and what was the working
>> directory when you ran the CLI command?
>>
>> has always been in /home/joe    I am running the CLI from there also
>> the working directory is dev/Arduino/sample/sample.ino  which is relative
>> to my ~ location. The abs path of the working directory would be
>> /home/joe/dev/Arduino/sample/sample.ino
>>
>> If your command is 'python pythonbuild.py
>> dev/Arduino/sample/sample.ino' then it must be executed in the
>> directory that contains 'pythonbuild.py' since the path is given
>> relative to the working directory (and so is
>> 'dev/Arduino/sample/sample.ino' but we havn't gotten to it yet :).
>>
>> yes, that is true
>>
>> Geany commands (by default) run with a working directory that is the
>> directory of the current file displayed in the edit area, you can
>> change this in the "working directory" column of the "set build
>> commands" dialog to make it a fixed location such as the directory
>> where 'pythonbuild.py' lives.
>>
>> so your saying move pythonbuild to my working directory, correct ?
>> Ok, I will try that. So maybe the problem is the there is no way for the
>> working
>> directory to get to reference the up stream directory ? as in its ok to
>> drill down but
>> not up ?? I will try try moving the *.py file to the working directory.
>>
>> Yes, so the working directory is just use  %d%f so the whole thing in
>> Geany
>> python home/joe/pythonbuild.py  %d/%f
>>
>> but I get Invalid working directory
>> "/home/joe/dev/Arduino/4X20OLED/4X20OLED.ino"
>>
>>
>>
>>
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>


More information about the Users mailing list