You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make moving backwards in mb.bat more predictable and stable.
Motivation
At the moment, back.bat performs the action of erasing previous changes - such as entering an asset - and taking you back to where you were before. It does so by erasing environment variables, but it couldn't erase those that were appended to e.g. PYTHONPATH without risking erasing more or less than it is supposed to.
:: Enter a project
set PYTHONPATH=/asset/scripts;%PYTHONPATH%
:: Back
:: How to erase an inserted path? Was there more than one inserted path? Who knows?set PYTHONPATH=???;%PYTHONPATH%
Implementation
When typing cmd from an existing terminal, your current environment is duplicated and put into a new terminal session. At this point, you are in a shell within a shell. Basically like Inception. And like Inception, you can exit one session which would take you back to the previous session.
The above session illustrates this in action. A new session is entered, where we attempt to echo a variable we haven't yet created. We then enter a new session, create it and echo it successfully.
We then type exit which closes this session, restoring the environment to how it was before entering it. In this case, %MYVAR% is removed.
The same applies to appending to variables, such as PATH and PYTHONPATH. Modifying these in a session within a session enabled the user to exit and restore the previous environment.
The text was updated successfully, but these errors were encountered:
Goal
Make moving backwards in
mb.bat
more predictable and stable.Motivation
At the moment,
back.bat
performs the action of erasing previous changes - such as entering an asset - and taking you back to where you were before. It does so by erasing environment variables, but it couldn't erase those that were appended to e.g.PYTHONPATH
without risking erasing more or less than it is supposed to.Implementation
When typing
cmd
from an existing terminal, your current environment is duplicated and put into a new terminal session. At this point, you are in a shell within a shell. Basically like Inception. And like Inception, you can exit one session which would take you back to the previous session.The above session illustrates this in action. A new session is entered, where we attempt to echo a variable we haven't yet created. We then enter a new session, create it and echo it successfully.
We then type
exit
which closes this session, restoring the environment to how it was before entering it. In this case,%MYVAR%
is removed.The same applies to appending to variables, such as
PATH
andPYTHONPATH
. Modifying these in a session within a session enabled the user to exit and restore the previous environment.The text was updated successfully, but these errors were encountered: