Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit f52d5ad

Browse files
authored
Update setup.py
1 parent 5fe1e3b commit f52d5ad

1 file changed

Lines changed: 26 additions & 11 deletions

File tree

setup/setup.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1+
import os
2+
import subprocess
3+
import sys
4+
15
# Path to the kernel script in the KERNEL folder
26
kernel_script = os.path.join(os.getcwd(), 'KERNEL', 'kernel.py')
37

4-
# setup.py
8+
# File paths for storing username and password
9+
username_file = "username.txt"
10+
password_file = "password.txt"
11+
12+
# If files exist, delete them to allow setting up a new username and password
13+
if os.path.isfile(username_file):
14+
os.remove(username_file)
15+
print(f"{username_file} has been deleted.")
16+
17+
if os.path.isfile(password_file):
18+
os.remove(password_file)
19+
print(f"{password_file} has been deleted.")
520

621
# Prompt the user for their username
722
username = input("Enter your username: ")
@@ -10,24 +25,24 @@
1025
password = input("Enter your password: ")
1126

1227
# Create a file named 'username.txt' and write the username in it
13-
with open("username.txt", "w") as user_file:
28+
with open(username_file, "w") as user_file:
1429
user_file.write(username)
1530

1631
# Create a file named 'password.txt' and write the password in it
17-
with open("password.txt", "w") as password_file:
32+
with open(password_file, "w") as password_file:
1833
password_file.write(password)
1934

20-
print("setup finished! thank you for using SkyOS!")
21-
print("going to the kernel file...")
22-
35+
print("Setup finished! Thank you for using SkyOS!")
36+
print("Going to the kernel file...")
37+
2338
# Check if the kernel script exists before trying to run it
2439
if os.path.isfile(kernel_script):
2540
try:
2641
# Run the kernel script as a subprocess
27-
subprocess.run([sys.executable, kernel_script], check=True)
28-
except subprocess.CalledProcessError as e:
29-
print(f"Error executing the kernel script: {e}")
30-
except Exception as e:
42+
subprocess.run([sys.executable, kernel_script], check=True)
43+
except subprocess.CalledProcessError as e:
44+
print(f"Error executing the kernel script: {e}")
45+
except Exception as e:
3146
print(f"An unexpected error occurred: {e}")
3247
else:
33-
print("yay! sucsess!")
48+
print("Kernel script not found. Please ensure it is located in the 'KERNEL' directory.")

0 commit comments

Comments
 (0)