-
-
Notifications
You must be signed in to change notification settings - Fork 201
Expand file tree
/
Copy pathoptions.ts
More file actions
45 lines (39 loc) · 1.26 KB
/
options.ts
File metadata and controls
45 lines (39 loc) · 1.26 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
///<reference path=".d.ts"/>
"use strict";
import path = require("path");
import commonOptions = require("./common/options");
import osenv = require("osenv");
import hostInfo = require("./common/host-info");
var knownOpts:any = {
"frameworkPath": String,
"copy-from": String,
"link-to": String,
"release": Boolean,
"emulator": Boolean,
"symlink": Boolean,
"for-device": Boolean,
"keyStorePath": String,
"keyStorePassword": String,
"keyStoreAlias": String,
"keyStoreAliasPassword": String
},
shorthands: IStringDictionary = {
};
_.extend(commonOptions.knownOpts, knownOpts);
_.extend(commonOptions.shorthands, shorthands);
var defaultProfileDir = "";
var nativeScriptCacheFolder = ".nativescript-cli";
if(hostInfo.isWindows()) {
defaultProfileDir = path.join(process.env.LocalAppData, nativeScriptCacheFolder);
} else {
defaultProfileDir = path.join(osenv.home(), ".local/share", nativeScriptCacheFolder);
}
commonOptions.setProfileDir(defaultProfileDir);
var errors: IErrors = $injector.resolve("errors");
_(errors.validateArgs("nativescript", commonOptions.knownOpts, commonOptions.shorthands)).each((val,key) => {
key = shorthands[key] || key;
commonOptions[key] = val;
}).value();
exports.knownOpts = knownOpts;
declare var exports:any;
export = exports;