I don't have access to a Mac or Linux.
Can somebody test the bash version of this for me?
Can somebody test this bash script for me?
Can somebody test this bash script for me?
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Can somebody test this bash script for me?
rm -rf is more or less the equivalent to rd /q /s, so it's advisable to place it at least in the first rm, to avoid displaying an error to the user when the directory doesn't exist. Also, the .git directory has write protected files, which makes rm prompt for confirmation unless -f is specified, so it's advisable to place it in the second rm too.
It lacks a line like: mv -f out.txt ../syntax/lua.vim
Just in case, it's better to stop in case a command errors, and let the user deal with the situation. That's done with set -e.
The docs should tell you to cd gen in order to run it, otherwise 'love .' won't work (that applies to the Windows version as well). Also, Linux users are not used to \ for directories.
And a minor nitpick, it's not a bash script, it's a sh script
So, here's gen.sh with these changes:
It lacks a line like: mv -f out.txt ../syntax/lua.vim
Just in case, it's better to stop in case a command errors, and let the user deal with the situation. That's done with set -e.
The docs should tell you to cd gen in order to run it, otherwise 'love .' won't work (that applies to the Windows version as well). Also, Linux users are not used to \ for directories.
And a minor nitpick, it's not a bash script, it's a sh script
So, here's gen.sh with these changes:
Code: Select all
#!/bin/sh
set -e
rm -rf love-api
git clone https://github.com/rm-code/love-api
love .> out.txt
rm -rf love-api
mv out.txt ../syntax/lua.vim
Re: Can somebody test this bash script for me?
Thanks for the help! I still have a lot to learn... Thanks for noticing I left out the move as well.
In Batch I did which sets the directory to the directory of the batch file. Would this do the trick?
I've updated the linked file. Do you mind testing it again?
Thanks for the help.
In Batch I did
Code: Select all
cd %~dp0
Code: Select all
cd "$(dirname "$0")"
I've updated the linked file. Do you mind testing it again?
Thanks for the help.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Can somebody test this bash script for me?
BTW, if you install this: https://www.cygwin.com/ it creates an environment with a bash interpreter in it. Simple download and install, won't litter your hard drive with junk. You just open a terminal window and there ya go ...
Cheers.
Cheers.
Old programmers never die, they just get disassembled...
Re: Can somebody test this bash script for me?
Thanks, that sounds a lot more convenient than asking other people to do it for me.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Can somebody test this bash script for me?
Missed that, sorry. I didn't know what %~dp0 meant. Yes, that should work.davisdude wrote:In Batch I didwhich sets the directory to the directory of the batch file. Would thisCode: Select all
cd %~dp0
do the trick?Code: Select all
cd "$(dirname "$0")"
It's working fine nowdavisdude wrote:I've updated the linked file. Do you mind testing it again?
Re: Can somebody test this bash script for me?
Thanks again
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Who is online
Users browsing this forum: No registered users and 1 guest