Closed Monarchz3ro closed 4 months ago
partially fixed, i think
partially fixed, i think
It should be fully fixed by my PR.
you've left out something, and i can't figure out what it is you're trying to do
That's just me who did weird stuff. I don't know what happened lol. Should be like this:
if self.__groups == "root":
self.__current_directory = os.path.join(self.__kernel,"root/root").replace("\\", "/")
else:
self.__current_directory = os.path.join(self.__kernel,"root/home/{self.__user}").replace("\\", "/")
self.current_directory = self.__current_directory
It's a function to change the current folder, depending on the user. If the user is a root, the directory changes to the /root/
one, else, the directory is /home/<user>/
. This function is ran when booting and when running the su command without the -p argument. I don't exactly remember why but there had to be a self.current_directory and a self.__current_directory variable.
I just found out why:
the ls.py script needs the self.__current_directory variable but, it cannot access it. So I made a self.current_directory variable just so it can be accessed. Let me make a quick PR to fix that.
Checkout #24
afterward, change
su
andsudo
so that they switch you into the changed user's home directory after that, implement -p intosu
so it retains the current directory