Skip to content

Commit

Permalink
Merge pull request #30 from anno-mods/devel/bundle-array
Browse files Browse the repository at this point in the history
allow arrays in bundle
  • Loading branch information
jakobharder authored Apr 16, 2023
2 parents dcd6f4b + bd8f537 commit d271552
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

## 1.12 Simplified Build and Deploy

- 1.12.3: Allow array in `bundle`
- 1.12.2: Export .png for icons as well
- 1.12.1: Support hierarchy of named `Group`s (with comments) in outline
- Build and deploy is now possible with `modinfo.json` files
Expand Down
22 changes: 2 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,20 @@
"name": "anno-modding-tools",
"displayName": "Anno Modding Tools",
"description": "Modding tools for Anno 1800",
"version": "1.12.2",
"version": "1.12.3",
"publisher": "JakobHarder",
"repository": {
"type": "git",
"url": "https://github.com/anno-mods/vscode-anno-modding-tools"
},
"engines": {
"vscode": "^1.60.0"
"vscode": "^1.75.0"
},
"icon": "images/icon.png",
"categories": [
"Other"
],
"activationEvents": [
"onLanguage:anno-cfg",
"onLanguage:anno-ifo",
"onLanguage:anno-cf7",
"onLanguage:anno-prp",
"onCommand:anno-modding-tools.buildMod",
"onCommand:anno-modding-tools.convertFcCf7",
"onCommand:anno-modding-tools.convertCf7Fc",
"onCommand:anno-modding-tools.patchCheckDiff",
"onCommand:anno-modding-tools.runTests",
"onCommand:anno-modding-tools.pngToDds",
"onCommand:anno-modding-tools.ddsToPng",
"onCommand:anno-modding-tools.importProps",
"onCommand:anno-modding-tools.importInfo",
"onCommand:anno-modding-tools.convertRdmToGlb",
"onCommand:anno-modding-tools.convertGltfToRdm",
"onCommand:anno-modding-tools.convertToRdpYaml",
"onCommand:anno-modding-tools.checkLoca",
"onCommand:anno-modding-tools.addMissingLoca",
"workspaceContains:**/assets.xml",
"onLanguage:xml"
],
Expand Down
8 changes: 5 additions & 3 deletions src/builder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ export class ModBuilder {
this._logger.log(`bundles`);

if (modJson.bundle) {
for (const bundle of Object.keys(modJson.bundle)) {
const fileName = path.basename(modJson.bundle[bundle]);
const bundles = Array.isArray(modJson.bundle) ? modJson.bundle : Object.values(modJson.bundle);

for (const bundle of bundles) {
const fileName = path.basename(bundle);
const targetPath = path.join(cache, 'downloads', fileName);
if (!fs.existsSync(targetPath)) {
this._logger.log(` * download ${fileName}`);
utils.downloadFile(modJson.bundle[bundle], targetPath, this._logger);
utils.downloadFile(bundle, targetPath, this._logger);
}
else {
this._logger.log(` * skip download of ${fileName}`);
Expand Down

0 comments on commit d271552

Please sign in to comment.