forked from Mirror/pmbootstrap
Check if workpath/ is empty and in that case create workpath/version (MR 1975)
Fixes https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1965
This commit is contained in:
parent
1b5120e24f
commit
efd64f7714
1 changed files with 4 additions and 0 deletions
|
@ -60,6 +60,10 @@ def ask_for_work_path(args):
|
|||
# Create the folder with a version file
|
||||
if not exists:
|
||||
os.makedirs(work, 0o700, True)
|
||||
|
||||
if not os.listdir(work):
|
||||
# Directory is empty, either because we just created it or
|
||||
# because user created it before running pmbootstrap init
|
||||
with open(work + "/version", "w") as handle:
|
||||
handle.write(str(pmb.config.work_version) + "\n")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue