[Seaside] Re: Anyone building seaside images on a mac with
Jenkins?
Gastón Dall' Oglio
gaston.dalloglio at gmail.com
Fri Oct 28 12:41:19 UTC 2011
Hi.
I am not a bash expert, I just want to share how to follow symbolic links
I've seen in a script:
#!/usr/bin/env bash
# Find our location
SELF_LOCATION=$(cd "$(dirname "$0")" ; pwd)
# Was this invoked as a link ?
if [ -L "$0" ]
then
LINKTO=$(/usr/bin/readlink "$0")
# Is the link a relative path
if [[ "${LINKTO}" = /* ]]
then
# absolute path so just invoke it
exec "${LINKTO}" "$@"
else
# invoke by prepending our folder
exec "${SELF_LOCATION}/${LINKTO}" "$@"
fi
fi
# Run IDE
"${SELF_LOCATION}/AptanaStudio3" -application
com.aptana.commandline.launcher.LauncherApplication "$@" > /dev/null 2>&1 &
# Detach it
disown -h %-
disown %-
2011/4/19 Randal L. Schwartz <merlyn at stonehenge.com>
> >>>>> "Sven" == Sven Van Caekenberghe <sven at beta9.be> writes:
>
> Sven> $(readlink -f $(dirname $0))
>
> readlink -f is a GNU-ism, apparently. And since OSX isn't GNU (it's
> mostly FreeBSD userland), not surprising it breaks.
>
> Sven> seems to be a trick to get at the absolute directory path the
> Sven> current script is in and it does not seem to work on Mac OS X, we
> Sven> always use
>
> Sven> MY_HOME=$(dirname $0)
> Sven> MY_HOME=$(cd $MY_HOME && pwd)
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
> <merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
> See http://methodsandmessages.posterous.com/ for Smalltalk discussion
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20111028/a9de3a24/attachment.htm
More information about the seaside
mailing list