Create your ansible collection from it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
608 B

#!/usr/bin/env python3
import os
import shutil
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
PROJECT_FOLDERS = (
"docs",
"plugins",
"roles",
)
def create_folder(filepath):
dir = os.path.join(PROJECT_DIRECTORY, filepath)
if not os.path.isdir(dir):
os.mkdir(dir)
def remove_file_or_folder(filepath):
fp = os.path.join(PROJECT_DIRECTORY, filepath)
if os.path.isdir(fp):
shutil.rmtree(fp)
else:
os.remove(fp)
def gen_role_folders():
for d in PROJECT_FOLDERS:
create_folder(d)
if __name__ == "__main__":
gen_role_folders()