-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmagic-script.js
More file actions
executable file
·105 lines (104 loc) · 3.24 KB
/
Copy pathmagic-script.js
File metadata and controls
executable file
·105 lines (104 loc) · 3.24 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/env node
// Copyright Magic Leap Inc. 2019
// Distributed under Apache 2.0 License. See LICENSE file in the project root for full license information.
'use strict';
require('yargs').usage('\n\n! Usage: Type magic-script <command> --help for detailed help !\n\n') // eslint-disable-line
.command('init [folderName] [packageName] [appType] [target] [visibleName]', 'Create a new project', yargs => {
yargs.positional('folderName', {
describe: 'Local folder to create project in.',
type: 'string'
});
yargs.positional('packageName', {
describe: 'The package identifier.',
type: 'string'
});
yargs.positional('visibleName', {
describe: 'The visible name of the project (optional)',
type: 'string'
});
yargs.positional('isComponents', {
describe: 'Choose if the app should be the Components app or the Vanilla MagicScript app',
boolean: true
});
yargs.positional('appType', {
describe: 'The type of the app. Can be either Landscape, Immersive or Components',
type: 'string'
});
yargs.option('target', {
alias: 't',
describe: 'Target platforms for Components app type. Can be a combination of iOS, Android and Lumin',
default: ['Lumin'],
type: 'array'
});
yargs.option('immersive', {
alias: 'i',
describe: 'Generate Immersive app Template',
boolean: true,
default: false
});
yargs.option('typeScript', {
describe: 'Should create typescript app',
boolean: true,
default: false
});
}, argv => require('../commands/init')(argv))
.command('install [target] [path]', 'Install the project', yargs => {
yargs.positional('path', {
describe: 'Path to the mpk',
default: '.out/app/app.mpk'
});
yargs.positional('target', {
describe: 'target(s) to build for',
default: 'lumin'
});
}, argv => require('../commands/install')(argv))
.command('build [target]', 'Compile project', yargs => {
yargs.option('debug', {
alias: 'd',
describe: 'build debug version of the app',
boolean: true,
default: true
});
yargs.option('install', {
alias: 'i',
describe: 'install on the device after build',
boolean: true,
default: false
});
yargs.option('host', {
alias: 'h',
describe: 'should build for Lumin on desktop',
boolean: true,
default: false
});
yargs.positional('target', {
describe: 'target(s) to build for',
default: 'lumin'
});
}, argv => require('../commands/build')(argv))
.command('remove', 'Remove project from device', argv => require('../commands/remove')(argv.argv))
.command('run [target]', 'Compile and run project', yargs => {
yargs.positional('target', {
describe: 'target(s) to build for',
default: 'lumin'
});
yargs.option('debug', {
alias: 'd',
description: 'run in debug mode',
boolean: true,
default: true
});
yargs.option('port', {
alias: 'p',
default: 0
});
}, argv => require('../commands/run')(argv))
.option('verbose', {
alias: 'v',
default: false
})
.wrap(null)
.demandCommand().recommendCommands().strict()
.showHelpOnFail(true)
.help()
.argv;