Skip to content

Commit

Permalink
Exclude fun parts from release
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsoft committed Nov 24, 2016
1 parent 6798c57 commit 2f03bbb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Tools/make_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# A very simple script to produce a .ZIP archive with the product distribution.

import getopt
import glob
import json
import logging
import os
Expand Down Expand Up @@ -72,6 +73,7 @@
'/settings.cfg',
],
'/GameData/KIS/Parts' : '/Parts',
'-/GameData/KIS/Parts' : '/fun_*',
'/GameData/KIS/Sounds' : '/Sounds',
'/GameData/KIS/Textures' : '/Textures',
'/GameData/KIS/Plugins' : [
Expand Down Expand Up @@ -125,9 +127,23 @@ def CleanupReleaseFolder():
# Creates whole release structure and copies the required files.
def MakeFoldersStructure():
print 'Make release folders structure...'
folders = sorted(STRUCTURE.keys())
folders = sorted(STRUCTURE.keys(), key=lambda x: x[0] != '-' and x or x[1:] + 'Z')
# Make.
for folder in folders:
if folder.startswith('-'):
# Drop files/directories.
del_path = DEST + folder[1:] + STRUCTURE[folder]
print 'Drop targets by pattern: %s' % del_path
for file_name in glob.glob(del_path):
if os.path.isfile(file_name):
print 'Dropping file "%s"' % file_name
os.unlink(file_name)
else:
print 'Dropping directory "%s"' % file_name
shutil.rmtree(file_name, True)
continue

# Copy files.
dest_path = DEST + folder
sources = STRUCTURE[folder]
if not isinstance(sources, list):
Expand All @@ -136,7 +152,7 @@ def MakeFoldersStructure():
shutil.copytree(src_path, dest_path)
else:
print 'Making folder "%s"' % dest_path
os.mkdir(DEST + folder)
os.mkdir(dest_path)
for file_path in STRUCTURE[folder]:
source_path = SRC + file_path
if file_path.endswith('/*'):
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Fix #152] Inventory reacts to flag writing.
- [Fix #157] MKS/OKS: NRE when adding MK-V Comm-Lab part.
- [Fix #135] NRE detaching and reattaching part with FAR.
- [Change] Exclude fun parts from the release.

### 1.3.0 (October 12th, 2016)
- [Enhancement] KSP 1.2 support
Expand Down

0 comments on commit 2f03bbb

Please sign in to comment.