added basic build env checks
This commit is contained in:
parent
6b6eaaa7cf
commit
e0e4345a31
25
scripts/build_env.py
Normal file
25
scripts/build_env.py
Normal 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()
|
||||||
Loading…
x
Reference in New Issue
Block a user