@open-audio-stack/core 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import path from 'path';
2
2
  import { Package } from './Package.js';
3
3
  import { Manager } from './Manager.js';
4
- import { archiveExtract, dirCreate, dirDelete, dirEmpty, dirRead, fileCreate, fileCreateJson, fileCreateYaml, fileExists, fileHash, fileInstall, fileOpen, fileReadJson, fileReadYaml, filesMove, isAdmin, runCliAsAdmin, } from '../helpers/file.js';
4
+ import { archiveExtract, dirCreate, dirDelete, dirEmpty, dirMove, dirRead, fileCreate, fileCreateJson, fileCreateYaml, fileExists, fileHash, fileInstall, fileOpen, fileReadJson, fileReadYaml, filesMove, isAdmin, runCliAsAdmin, } from '../helpers/file.js';
5
5
  import { isValidVersion, pathGetSlug, pathGetVersion, toSlug } from '../helpers/utils.js';
6
6
  import { commandExists, getArchitecture, getSystem, isTests } from '../helpers/utilsLocal.js';
7
7
  import { apiBuffer } from '../helpers/api.js';
@@ -14,7 +14,7 @@ import { presetFormatDir } from '../types/PresetFormat.js';
14
14
  import { projectFormatDir } from '../types/ProjectFormat.js';
15
15
  import { FileFormat } from '../types/FileFormat.js';
16
16
  import { licenses } from '../types/License.js';
17
- import { pluginTypes } from '../types/PluginType.js';
17
+ import { PluginType, pluginTypes } from '../types/PluginType.js';
18
18
  import { presetTypes } from '../types/PresetType.js';
19
19
  import { projectTypes } from '../types/ProjectType.js';
20
20
  import { SystemType } from '../types/SystemType.js';
@@ -214,12 +214,21 @@ export class ManagerLocal extends Manager {
214
214
  if (this.type === RegistryType.Projects)
215
215
  formatDir = projectFormatDir;
216
216
  archiveExtract(filePath, dirSource);
217
- const filesMoved = filesMove(dirSource, this.typeDir, dirSub, formatDir);
218
- // Output json metadata into every directory a file was added to.
219
- filesMoved.forEach((fileMoved) => {
220
- const fileJson = path.join(path.dirname(fileMoved), 'index.json');
221
- fileCreateJson(fileJson, pkgVersion);
222
- });
217
+ // Move entire directory, maintaining the same folder structure.
218
+ if (pkgVersion.type === PluginType.Sampler) {
219
+ const dirTarget = path.join(this.typeDir, PluginType.Sampler, dirSub);
220
+ dirCreate(dirTarget);
221
+ dirMove(dirSource, dirTarget);
222
+ fileCreateJson(path.join(dirTarget, 'index.json'), pkgVersion);
223
+ }
224
+ else {
225
+ // Move only supported file extensions into their respective installation directories.
226
+ const filesMoved = filesMove(dirSource, this.typeDir, dirSub, formatDir);
227
+ filesMoved.forEach((fileMoved) => {
228
+ const fileJson = path.join(path.dirname(fileMoved), 'index.json');
229
+ fileCreateJson(fileJson, pkgVersion);
230
+ });
231
+ }
223
232
  }
224
233
  }
225
234
  pkgVersion.installed = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-audio-stack/core",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Open-source audio plugin management software",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",