On Fri, Dec 11, 2020 at 10:41 AM Martin Grigorov <mgrigo...@apache.org>
wrote:

> Hi Rainer,
>
> On Fri, Dec 11, 2020 at 10:37 AM Rainer Jung <rainer.j...@kippdata.de>
> wrote:
>
>> Am 11.12.2020 um 08:25 schrieb mgrigo...@apache.org:
>> > This is an automated email from the ASF dual-hosted git repository.
>> >
>> > mgrigorov pushed a commit to branch master
>> > in repository
>> https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git
>> >
>> >
>> > The following commit(s) were added to refs/heads/master by this push:
>> >       new 000c876  Make migrate.sh usable from any directory
>> > 000c876 is described below
>> >
>> > commit 000c876ea3a1e700df2fffef70b29d9c3a9dfef2
>> > Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
>> > AuthorDate: Fri Dec 11 09:22:22 2020 +0200
>> >
>> >      Make migrate.sh usable from any directory
>> >
>> >      Until now one has to `cd` to the bin/ folder to be able to execute
>> migrate.sh, otherwise lib/ folder won't be found
>> > ---
>> >   src/main/scripts/migrate.sh | 4 +++-
>> >   1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/src/main/scripts/migrate.sh b/src/main/scripts/migrate.sh
>> > index c2b941c..3d3f34c 100755
>> > --- a/src/main/scripts/migrate.sh
>> > +++ b/src/main/scripts/migrate.sh
>> > @@ -1,4 +1,6 @@
>> >   #!/bin/sh
>> >
>> > +BIN_FOLDER=`dirname $PWD/$0`
>>
>> Does that work if $0 is an absolute path?
>>
>
> Yes, it does. I have tested it!
> BIN_FOLDER looks a bit strange: ///some/absolute/path/bin but it works
> just fine on my Ubuntu.
> Does it work on Solaris ? :-)
>
>
>>
>> Maybe one could
>>
>>    cd `dirname $0`
>>
>
Two issues with this:

1) the script usage is: ./bin/migrate.sh input.war output.war
if we "cd" into bin/ then input.war is not there anymore. Its path should
be fixed to ../input.war somehow

2) it would be good to leave the user back to the original directory after
executing the script but pushd/popd are not available for 'sh'. We will
need to use Bash or another


>
>> Regards,
>>
>> Rainer
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>>
>>

Reply via email to