pathpackage at your disposal there is really no need to use cd, pushd or popd.
This probably won't be an issue for you as DCli will NEVER start an Isolate and most scripts don't need to use Isolates, but best pratices says that you should assume that one day you might just need to use one, so read on...Dart and consequently DCli allow you to run multiple threads of execution via Isolates.The problem is that all of these Isolates running in your Dart process share a single common working directory (CWD or PWD).This means that if you use CD in one isolate, then all other isolates have their working directory changed under their feet.Imagine if you are about to do a recusive delete in one isolate and some other Isolate changes the working directory to
/.Oops you just deleted your entire file system.
What happens if you call a function that happens to change the working directory?Again you can end up deleting your entire file system if the function changes to
/.3) Another process deletes your working directory What happens if another process deletes your working directory just as you are about to delete all of its contents? If you are using the 'paths' package then it will climb the path until it finds a directory that exists and set that as you new working directory. Your new working directory could well be the root directory.