Skip to content

Merge release #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ $injector.requireCommand("list-devices", "./commands/list-devices");

$injector.require("npm", "./node-package-manager");
$injector.require("config", "./config");
$injector.require("optionsService", "./services/options-service");
13 changes: 11 additions & 2 deletions lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path = require("path");
import helpers = require("./common/helpers");
import commonOptions = require("./common/options");
import osenv = require("osenv");
import hostInfo = require("./common/host-info");

var knownOpts:any = {
"frameworkPath": String,
Expand All @@ -23,11 +24,19 @@ var knownOpts:any = {
_.extend(knownOpts, commonOptions.knownOpts);
_.extend(shorthands, commonOptions.shorthands);

commonOptions.setProfileDir(".nativescript-cli");
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 parsed = helpers.getParsedOptions(knownOpts, shorthands);

Object.keys(parsed).forEach((opt) => exports[opt] = parsed[opt]);
exports.knownOpts = knownOpts;

declare var exports:any;
export = exports;
export = exports;
12 changes: 12 additions & 0 deletions lib/services/options-service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
///<reference path="../.d.ts"/>

"use strict";

import options = require("../options");

export class OptionsService implements IOptionsService {
public getKnownOptions(): string[]{
return Object.keys(options.knownOpts);
}
}
$injector.register("optionsService", OptionsService);
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nativescript",
"preferGlobal": true,
"version": "0.3.2",
"version": "0.4.0",
"author": "Telerik <support@telerik.com>",
"description": "Command-line interface for building NativeScript projects",
"bin": {
Expand Down Expand Up @@ -50,7 +50,7 @@
"underscore": "1.5.2",
"unzip": "0.1.9",
"watchr": "2.4.11",
"xmlhttprequest": "1.6.0",
"xmlhttprequest": "https://github.com/telerik/node-XMLHttpRequest/tarball/master",
"yargs": "1.2.2"
},
"analyze": true,
Expand Down
8 changes: 8 additions & 0 deletions test/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ export class FileSystemStub implements IFileSystem {
symlink(sourePath: string, destinationPath: string): IFuture<void> {
return undefined;
}

closeStream(stream: any): IFuture<void> {
return undefined;
}

setCurrentUserAsOwner(path: string, owner: string): IFuture<void> {
return undefined;
}
}

export class ErrorsStub implements IErrors {
Expand Down