On 31.08.2022 11:27, Jan Rękorajski wrote: > Where will it land now? If you want to protect against landing in > non-existing directory you can use '[ -d "$__PWD" ] && cd "$__PWD"' > I really prefer to be staying in the same directory where I launched > the script in.
I considered doing `test -d` but since this new old $PWD doesn't affect any other command I've just dropped it entirely. I will bring it back with test then. > On Wed, Aug 31, 2022 at 12:59 AM atler <at...@pld-linux.org> wrote: > > > > commit b1e8c12b2d66e7aadd9bb2c0d1acfc612d50aa22 > > Author: Jan Palus <at...@pld-linux.org> > > Date: Wed Aug 31 00:55:46 2022 +0200 > > > > builder: don't bother going back to original $(pwd) at the end of script > > > > no real use for it as far as I can tell and ditching it avoids error if > > original working directory does not exist anymore (because ie it > > happened to be $RPM_BUILD_ROOT) > > > > builder.sh | 1 - > > 1 file changed, 1 deletion(-) > > --- > > diff --git a/builder.sh b/builder.sh > > index 058d0de..68bb875 100755 > > --- a/builder.sh > > +++ b/builder.sh > > @@ -2756,6 +2756,5 @@ esac > > if [ -f "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES" -a > > "$REMOVE_BUILD_REQUIRES" != "" ]; then > > rm "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES" > > fi > > -cd "$__PWD" > > > > # vi:syntax=sh:ts=4:sw=4:noet > > ================================================================ > > > > ---- gitweb: > > > > http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/b1e8c12b2d66e7aadd9bb2c0d1acfc612d50aa22 > > > > _______________________________________________ > > pld-cvs-commit mailing list > > pld-cvs-com...@lists.pld-linux.org > > http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit > > > > -- > Jan Rękorajski | SysAdm | PLD/Linux | http://www.pld-linux.org/ > baggins<at>pld-linux.org > _______________________________________________ > pld-devel-pl mailing list > pld-devel-pl@lists.pld-linux.org > http://lists.pld-linux.org/mailman/listinfo/pld-devel-pl _______________________________________________ pld-devel-pl mailing list pld-devel-pl@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-pl