|
|
|
@ -105,39 +105,39 @@ def create_changelog_entry(new_version, parent=PATH_ISSUES):
@@ -105,39 +105,39 @@ def create_changelog_entry(new_version, parent=PATH_ISSUES):
|
|
|
|
|
fh.write(CRLF.join(content)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def copy_changelog(destination, release_version): |
|
|
|
|
def copy_changelog(destination, build_version): |
|
|
|
|
textfiles = _files_in_folder(PATH_ISSUES, ".txt") |
|
|
|
|
changelog = next(f for f in textfiles if f.stem.lower().startswith("change")) |
|
|
|
|
new_path = destination / f"CHANGELOG {release_version}.txt" |
|
|
|
|
new_path = destination / f"CHANGELOG {build_version}.txt" |
|
|
|
|
print(changelog.name, "->", new_path) |
|
|
|
|
shutil.copyfile(changelog, new_path) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def copy_workbook_changelogs(destination, latest, release_version): |
|
|
|
|
def copy_workbook_changelogs(destination, latest, build_version): |
|
|
|
|
source = PATH_ISSUES / latest |
|
|
|
|
textfiles = _files_in_folder(source, ".txt") |
|
|
|
|
logs = (f for f in textfiles if f.stem.lower().startswith("change")) |
|
|
|
|
for log_file in logs: |
|
|
|
|
new_name = log_file.name.replace(latest, release_version) |
|
|
|
|
new_name = log_file.name.replace(latest, build_version) |
|
|
|
|
new_path = destination / new_name |
|
|
|
|
print(log_file.name, "->", new_path) |
|
|
|
|
shutil.copyfile(log_file, new_path) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def copy_workbooks(destination, release_version): |
|
|
|
|
def copy_workbooks(destination, build_version): |
|
|
|
|
all_xls_files = _files_in_folder(PATH_WORKBOOKS, ".xlsx") |
|
|
|
|
mbp_files = (f for f in all_xls_files if f.name.lower().startswith("mbp")) |
|
|
|
|
for excel_file in mbp_files: |
|
|
|
|
new_name = WORKBOOKS_MAP[excel_file.name] |
|
|
|
|
new_path = destination / new_name.format(version=release_version) |
|
|
|
|
new_path = destination / new_name.format(version=build_version) |
|
|
|
|
print(excel_file.name, "->", new_path) |
|
|
|
|
shutil.copyfile(excel_file, new_path) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def copy_frms(destination, release_version): |
|
|
|
|
def copy_frms(destination, build_version): |
|
|
|
|
all_folders = (f for f in PATH_WORKBOOKS.iterdir() if f.is_dir()) |
|
|
|
|
all_frms = (f for f in all_folders if "frm" in f.name.lower()) |
|
|
|
|
current_frms = (f for f in all_frms if f.name.endswith(release_version)) |
|
|
|
|
current_frms = (f for f in all_frms if f.name.endswith(build_version)) |
|
|
|
|
for folder in current_frms: |
|
|
|
|
new_path = destination / folder.name |
|
|
|
|
print(folder.name, "->", new_path) |
|
|
|
@ -173,7 +173,7 @@ def sg_mbp_new_version(version):
@@ -173,7 +173,7 @@ def sg_mbp_new_version(version):
|
|
|
|
|
required=True, |
|
|
|
|
default="", |
|
|
|
|
) |
|
|
|
|
def sg_mbp_release(dev_version): |
|
|
|
|
def sg_mbp_build(dev_version): |
|
|
|
|
""" |
|
|
|
|
Before running this command: |
|
|
|
|
|
|
|
|
@ -186,16 +186,16 @@ def sg_mbp_release(dev_version):
@@ -186,16 +186,16 @@ def sg_mbp_release(dev_version):
|
|
|
|
|
The command will collect all data into one folder on the Desktop to be published |
|
|
|
|
""" |
|
|
|
|
latest = get_latest_version() |
|
|
|
|
release_version = f"{latest}{dev_version}" |
|
|
|
|
build_version = f"{latest}{dev_version}" |
|
|
|
|
|
|
|
|
|
new_folder_name = f"{TODAY} {release_version}" |
|
|
|
|
new_folder_name = f"{TODAY} {build_version}" |
|
|
|
|
new_folder_path = PATH_WIN_DESKTOP / new_folder_name |
|
|
|
|
if new_folder_path.exists(): |
|
|
|
|
raise IOError(f"Folder exists on desktop: {new_folder_name}") |
|
|
|
|
else: |
|
|
|
|
new_folder_path.mkdir() |
|
|
|
|
|
|
|
|
|
copy_workbooks(new_folder_path, release_version) |
|
|
|
|
copy_workbook_changelogs(new_folder_path, latest, release_version) |
|
|
|
|
copy_changelog(new_folder_path, release_version) |
|
|
|
|
copy_frms(new_folder_path, release_version) |
|
|
|
|
copy_workbooks(new_folder_path, build_version) |
|
|
|
|
copy_workbook_changelogs(new_folder_path, latest, build_version) |
|
|
|
|
copy_changelog(new_folder_path, build_version) |
|
|
|
|
copy_frms(new_folder_path, build_version) |