Garbage in PATH env var #927

Closed
Tercete opened this Issue Apr 25, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@Tercete

Tercete commented Apr 25, 2015

Hi... This is not a bug, but an inconvenient.
When you use this tool many times, it changes the PATH environment variable, appending the actual directory, many times...
To avoid this behavior, I suggest this:

@echo off
if "%PATH_BASE%" == "" set PATH_BASE=%PATH%
set PATH=%CD%;%PATH_BASE%;
java -jar -Duser.language=en "%~dp0\apktool.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9

Thanks in advance...

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Apr 27, 2015

Owner

Can you explain what the code you added changes? It looks to see if PATH_BASE is empty, then set it to PATH, but then it just sets PATH to current directory + PATH_BASE. This doesn't seem to fix the problem by looking at the code.

However, when actually testing it. It does fix it. The PATH only gains one iteration of the current directory, thus works. So thanks! I'll get this merged.

Owner

iBotPeaches commented Apr 27, 2015

Can you explain what the code you added changes? It looks to see if PATH_BASE is empty, then set it to PATH, but then it just sets PATH to current directory + PATH_BASE. This doesn't seem to fix the problem by looking at the code.

However, when actually testing it. It does fix it. The PATH only gains one iteration of the current directory, thus works. So thanks! I'll get this merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment