[Gambas-user] Run command after making exe (options)
Bruce Steers
bsteers4 at gmail.com
Mon Feb 15 17:29:01 CET 2021
On Sun, 14 Feb 2021 at 21:02, Bruce Steers <bsteers4 at gmail.com> wrote:
> Hi.
> I'm trying to use the "Run command after" option when making an exe to
> auto-alter some version texts in various files
> i made a gbs script file that i can place in the source folder and it does
> the version change okay but i can't launch it.
>
> tooltip says use $(FILE) for exe name
>
> What i need is $(PATH) for source folder (i tried that and it didn't work)
>
> are there any other options i can use with this feature except $(FILE)
>
> I've attatched the script so you can see what i'm trying to accomplish
>
Okay well i've made do with what i had and did this , so il'll share it
with you folks.
Simple version replacement script.
What it does...
when i select "Make executable" in gambas i have now set the "Run this
command after" option to this...
*gbs3 /media/bonus/SSDiskspace/git/SetVers.gbs '$(FILE)' 'Version "*"'
README.md @VERSION*
The SetVers.gbs script stays in /media/bonus/SSDiskspace/git/ and i'm using
it in a few of my projects.
It's arguments are
*SetVers.gbs <gambas exe path> <version search string> <files>*
The only option i see is $(FILE) when making an exe so the first arg for
SetVers.gbs is more for getting the programs directory than the name.
In my README.md file is the line..
*## ScriptED Version "2.5.2"*
my VERSION file just contains the version number. 2.5.2
after gambas makes the executable it then runs this script.
the script gets the program version number from the .project file and then
replaces via the supplied pattern 'Version "*"' so all between the quotes
is replaced. (could use brackets or any other text)
Because VERSION file argument begins with @ this just has the version
number written to it without pattern matching. just the number written to a
file.
So now i no longer have to keep updating my README.md and VERSION files
version number.
I can supply any number of files as arguments.
you may find it useful too.
or a base to make something even more useful :)
Wishing well
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210215/79c2647f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SetVers.gbs.zip
Type: application/zip
Size: 1041 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210215/79c2647f/attachment-0001.zip>
More information about the User
mailing list