@open-audio-stack/core 0.1.40 → 0.1.42
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.
- package/build/classes/ManagerLocal.js +29 -5
- package/build/helpers/file.js +11 -0
- package/package.json +1 -1
|
@@ -58,7 +58,10 @@ export class ManagerLocal extends Manager {
|
|
|
58
58
|
];
|
|
59
59
|
const pkgAnswers = await inquirer.prompt(pkgQuestions);
|
|
60
60
|
let types = pluginTypes;
|
|
61
|
-
if (this.type === RegistryType.
|
|
61
|
+
if (this.type === RegistryType.Apps) {
|
|
62
|
+
types = pluginTypes;
|
|
63
|
+
}
|
|
64
|
+
else if (this.type === RegistryType.Presets) {
|
|
62
65
|
types = presetTypes;
|
|
63
66
|
}
|
|
64
67
|
else if (this.type === RegistryType.Projects) {
|
|
@@ -234,9 +237,11 @@ export class ManagerLocal extends Manager {
|
|
|
234
237
|
const dirSource = path.join(this.config.get('appDir'), file.type, this.type, slug, versionNum);
|
|
235
238
|
const dirSub = path.join(slug, versionNum);
|
|
236
239
|
let formatDir = pluginFormatDir;
|
|
237
|
-
if (this.type === RegistryType.
|
|
240
|
+
if (this.type === RegistryType.Apps)
|
|
241
|
+
formatDir = pluginFormatDir;
|
|
242
|
+
else if (this.type === RegistryType.Presets)
|
|
238
243
|
formatDir = presetFormatDir;
|
|
239
|
-
if (this.type === RegistryType.Projects)
|
|
244
|
+
else if (this.type === RegistryType.Projects)
|
|
240
245
|
formatDir = projectFormatDir;
|
|
241
246
|
await archiveExtract(filePath, dirSource);
|
|
242
247
|
// Move entire directory, maintaining the same folder structure.
|
|
@@ -342,8 +347,27 @@ export class ManagerLocal extends Manager {
|
|
|
342
347
|
}
|
|
343
348
|
try {
|
|
344
349
|
const openPath = openableFile.open;
|
|
345
|
-
const
|
|
346
|
-
|
|
350
|
+
const fileExt = path.extname(openPath).slice(1).toLowerCase();
|
|
351
|
+
let formatDir = pluginFormatDir[fileExt] || 'Plugin';
|
|
352
|
+
if (this.type === RegistryType.Apps)
|
|
353
|
+
formatDir = pluginFormatDir[fileExt] || 'App';
|
|
354
|
+
else if (this.type === RegistryType.Presets)
|
|
355
|
+
formatDir = presetFormatDir[fileExt] || 'Preset';
|
|
356
|
+
else if (this.type === RegistryType.Projects)
|
|
357
|
+
formatDir = projectFormatDir[fileExt] || 'Project';
|
|
358
|
+
const packageDir = path.join(this.typeDir, formatDir, slug, versionNum);
|
|
359
|
+
let fullPath;
|
|
360
|
+
if (path.isAbsolute(openPath)) {
|
|
361
|
+
fullPath = openPath;
|
|
362
|
+
}
|
|
363
|
+
else if (fileExt === 'app') {
|
|
364
|
+
// For .app bundles, construct path to executable inside Contents/MacOS/
|
|
365
|
+
const appName = path.basename(openPath, '.app');
|
|
366
|
+
fullPath = path.join(packageDir, openPath, 'Contents', 'MacOS', appName);
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
fullPath = path.join(packageDir, openPath);
|
|
370
|
+
}
|
|
347
371
|
const command = `"${fullPath}" ${options.join(' ')}`;
|
|
348
372
|
this.log(`Running: ${command}`);
|
|
349
373
|
if (isTests()) {
|
package/build/helpers/file.js
CHANGED
|
@@ -262,6 +262,17 @@ export function filesMove(dirSource, dirTarget, dirSub, formatDir) {
|
|
|
262
262
|
return log(`${fileSource} - ${fileTarget} already exists, skipping.`);
|
|
263
263
|
dirCreate(path.dirname(fileTarget));
|
|
264
264
|
fileMove(fileSource, fileTarget);
|
|
265
|
+
// Set executable permissions for executable file types
|
|
266
|
+
if (fileExt === 'app') {
|
|
267
|
+
// For .app bundles, find and set permissions on the actual executable
|
|
268
|
+
const executablePath = path.join(fileTarget, 'Contents', 'MacOS', path.basename(fileTarget, '.app'));
|
|
269
|
+
if (fileExists(executablePath)) {
|
|
270
|
+
fileExec(executablePath);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
else if (['elf', 'exe'].includes(fileExt)) {
|
|
274
|
+
fileExec(fileTarget);
|
|
275
|
+
}
|
|
265
276
|
filesMoved.push(fileTarget);
|
|
266
277
|
});
|
|
267
278
|
return filesMoved;
|