mission_merger.py 914 B

1234567891011121314151617181920212223242526272829
  1. #This was written for the 501st Starsim unit in Arma3
  2. #For faster mission integration with mission scripts
  3. #Written by CC Klein copyright 2018
  4. import os
  5. from distutils.dir_util import *
  6. #Creating String values for Directory Structure
  7. dir = os.path.dirname(__file__)
  8. filename = os.path.join(dir, '../../Missions/')
  9. tmp_file = filename+"Temp/"
  10. script_files = os.path.join(dir, '../../Scripts')
  11. mission_files = os.listdir(filename)
  12. #If temp dir exists delete then continue
  13. if os.path.isdir(tmp_file) == True:
  14. remove_tree(tmp_file)
  15. #For each mission folder in mission_files copy them to
  16. #tmp dir then copy scripts into mission tmp dir
  17. for name in mission_files:
  18. if name.endswith('.txt') == False and name != 'Temp':
  19. print(name)
  20. src_dir = filename+name
  21. tmp_dir = tmp_file+name
  22. mkpath(tmp_dir)
  23. copy_tree(src_dir, tmp_dir)
  24. copy_tree(script_files, tmp_dir)