-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathoptions.ts
61 lines (57 loc) · 2.41 KB
/
options.ts
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
///<reference path=".d.ts"/>
"use strict";
import * as commonOptionsLibPath from "./common/options";
import * as osenv from "osenv";
import * as path from "path";
let OptionType = commonOptionsLibPath.OptionType;
export class Options extends commonOptionsLibPath.OptionsBase {
constructor($errors: IErrors,
$staticConfig: IStaticConfig,
$hostInfo: IHostInfo) {
super({
ipa: { type: OptionType.String },
frameworkPath: { type: OptionType.String },
frameworkName: { type: OptionType.String },
framework: { type: OptionType.String },
frameworkVersion: { type: OptionType.String },
copyFrom: { type: OptionType.String },
linkTo: { type: OptionType.String },
symlink: { type: OptionType.Boolean },
forDevice: { type: OptionType.Boolean },
client: { type: OptionType.Boolean, default: true},
production: { type: OptionType.Boolean },
debugTransport: {type: OptionType.Boolean},
keyStorePath: { type: OptionType.String },
keyStorePassword: { type: OptionType.String,},
keyStoreAlias: { type: OptionType.String },
keyStoreAliasPassword: { type: OptionType.String },
ignoreScripts: {type: OptionType.Boolean },
tnsModulesVersion: { type: OptionType.String },
staticBindings: {type: OptionType.Boolean},
compileSdk: {type: OptionType.Number },
port: { type: OptionType.Number },
copyTo: { type: OptionType.String },
baseConfig: { type: OptionType.String },
platformTemplate: { type: OptionType.String },
ng: {type: OptionType.Boolean }
},
path.join($hostInfo.isWindows ? process.env.AppData : path.join(osenv.home(), ".local/share"), ".nativescript-cli"),
$errors, $staticConfig);
// On Windows we moved settings from LocalAppData to AppData. Move the existing file to keep the existing settings
// I guess we can remove this code after some grace period, say after 1.7 is out
if ($hostInfo.isWindows) {
try {
let shelljs = require("shelljs"),
oldSettings = path.join(process.env.LocalAppData, ".nativescript-cli", "user-settings.json"),
newSettings = path.join(process.env.AppData, ".nativescript-cli", "user-settings.json");
if (shelljs.test("-e", oldSettings) && !shelljs.test("-e", newSettings)) {
shelljs.mkdir(path.join(process.env.AppData, ".nativescript-cli"));
shelljs.mv(oldSettings, newSettings);
}
} catch (err) {
// ignore the error - it is too early to use $logger here
}
}
}
}
$injector.register("options", Options);