Merge pull request #546 from mcarlton00/dev-build-argument

Add argument for dev mode to build script
This commit is contained in:
Odd Stråbø 2021-07-18 11:18:41 +02:00 committed by GitHub
commit 79f872eb42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,7 +63,7 @@ def create_addon_xml(config: dict, source: str, py_version: str) -> None:
tree.write('{}/addon.xml'.format(source), encoding='utf-8', xml_declaration=True) tree.write('{}/addon.xml'.format(source), encoding='utf-8', xml_declaration=True)
def zip_files(py_version: str, source: str, target: str) -> None: def zip_files(py_version: str, source: str, target: str, dev: bool) -> None:
""" """
Create installable addon zip archive Create installable addon zip archive
""" """
@ -73,7 +73,7 @@ def zip_files(py_version: str, source: str, target: str) -> None:
for root, dirs, files in os.walk(args.source): for root, dirs, files in os.walk(args.source):
for filename in filter(file_filter, files): for filename in filter(file_filter, files):
file_path = os.path.join(root, filename) file_path = os.path.join(root, filename)
if folder_filter(file_path): if dev or folder_filter(file_path):
relative_path = os.path.join('plugin.video.jellyfin', os.path.relpath(file_path, source)) relative_path = os.path.join('plugin.video.jellyfin', os.path.relpath(file_path, source))
z.write(file_path, relative_path) z.write(file_path, relative_path)
@ -113,6 +113,9 @@ if __name__ == '__main__':
type=Path, type=Path,
default=Path(__file__).absolute().parent) default=Path(__file__).absolute().parent)
parser.add_argument('--dev', dest='dev', action='store_true')
parser.set_defaults(dev=False)
args = parser.parse_args() args = parser.parse_args()
# Load config file # Load config file
@ -122,4 +125,4 @@ if __name__ == '__main__':
create_addon_xml(release_config, args.source, args.version) create_addon_xml(release_config, args.source, args.version)
zip_files(args.version, args.source, args.target) zip_files(args.version, args.source, args.target, args.dev)