Somewhat missnamed branch build-scripts merge with main #3

Merged
kryddan merged 7 commits from build-scripts into main 2025-02-12 10:30:49 +01:00
Showing only changes of commit e0e4345a31 - Show all commits

25
scripts/build_env.py Normal file
View File

@ -0,0 +1,25 @@
import os
def buildEnvExists():
try:
result = os.lstat("work")
except FileNotFoundError:
result = "-1"
except e:
result = "-2"
if result == "-2":
print(f"Encountered an unexpected error {e}")
print("exiting...")
return
if result == "-1":
print("Work doesn't exist, initializing build environment")
return
print("Work exists, no filesystem things to do")
if os.access("work", os.W_OK):
print("write access checked inside work, nothing to do")
else:
print("work is not writable, change permissions of dir")
if __name__ == "__main__":
buildEnvExists()