-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathapp_alloy.js
More file actions
50 lines (46 loc) · 1.09 KB
/
app_alloy.js
File metadata and controls
50 lines (46 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* @overview
* Logic for creating new Titanium apps.
*
* @copyright
* Copyright TiDev, Inc. 04/07/2022-Present
*
* @license
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
import { BaseAppCreator } from './base_app.js';
import { execSync } from 'node:child_process';
/**
* Creates application projects.
*
* @module lib/creators/app
*/
export class AppCreator extends BaseAppCreator {
/**
* Constructs the app creator.
* @class
* @classdesc Creates an app project.
* @constructor
* @param {Object} logger - The logger instance
* @param {Object} config - The CLI config
* @param {Object} cli - The CLI instance
*/
constructor(logger, config, cli) { // eslint-disable-line no-unused-vars
super(logger, config, cli, {
title: 'Titanium App (Alloy)',
titleOrder: 2,
type: 'alloy'
});
}
init() {
// check if alloy is installed
try {
execSync('alloy --version');
} catch (err) {
throw new Error('Alloy is not installed');
}
return super.init();
}
}
export default AppCreator;