Skip to content

Commit 762cfa4

Browse files
committed
Setup and cloud setup commands
1 parent 9401dde commit 762cfa4

File tree

6 files changed

+70
-3
lines changed

6 files changed

+70
-3
lines changed

docs/man_pages/cloud/cloud-setup.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<% if (isJekyll) { %>---
2+
title: tns cloud setup
3+
position: 5
4+
---<% } %>
5+
# tns cloud setup
6+
==========
7+
8+
Usage | Synopsis
9+
------|-------
10+
Install the nativescript-cloud extension | `$ tns cloud setup`
11+
12+
Install the nativescript-cloud extension to configure your environment for cloud builds.
13+
14+
### Related Commands
15+
16+
Command | Description
17+
----------|----------
18+
[setup](setup.html) | Run the setup script to try to automatically configure your environment for local builds.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<% if (isJekyll) { %>---
2+
title: tns setup
3+
position: 5
4+
---<% } %>
5+
# tns setup
6+
==========
7+
8+
Usage | Synopsis
9+
------|-------
10+
Run the setup script | `$ tns setup`
11+
12+
Run the setup script to try to automatically configure your environment for local builds.
13+
14+
### Related Commands
15+
16+
Command | Description
17+
----------|----------
18+
[setup cloud](setup-cloud.html) | Install the nativescript-cloud extension to configure your environment for cloud builds.

lib/bootstrap.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ $injector.requireCommand("appstore|upload", "./commands/appstore-upload");
7272
$injector.requireCommand("publish|ios", "./commands/appstore-upload");
7373
$injector.require("itmsTransporterService", "./services/itmstransporter-service");
7474

75+
$injector.requireCommand("setup", "./commands/setup");
76+
$injector.requireCommand("cloud|setup", "./commands/setup");
77+
7578
$injector.requirePublic("npm", "./node-package-manager");
7679
$injector.require("npmInstallationManager", "./npm-installation-manager");
7780
$injector.require("dynamicHelpProvider", "./dynamic-help-provider");

lib/commands/build.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ export class BuildCommandBase {
99
protected $platformService: IPlatformService,
1010
private $bundleValidatorHelper: IBundleValidatorHelper,
1111
private $platformEnvironmentRequirements: IPlatformEnvironmentRequirements) {
12-
super($projectData, $errors, $options);
13-
this.$projectData.initializeProjectData();
12+
this.$projectData.initializeProjectData();
1413
}
1514

1615
public async executeCore(args: string[]): Promise<void> {

lib/commands/setup.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
export class SetupCommand implements ICommand {
2+
public allowedParameters: ICommandParameter[] = [];
3+
4+
constructor(private $doctorService: IDoctorService) { }
5+
6+
public async execute(args: string[]): Promise<any> {
7+
return this.$doctorService.runSetupScript();
8+
}
9+
10+
public async canExecute(args: string[]): Promise<boolean> {
11+
return true;
12+
}
13+
}
14+
$injector.registerCommand("setup", SetupCommand);
15+
16+
export class CloudSetupCommand implements ICommand {
17+
public allowedParameters: ICommandParameter[] = [];
18+
19+
constructor(private $extensibilityService: IExtensibilityService) { }
20+
21+
public async execute(args: string[]): Promise<any> {
22+
return this.$extensibilityService.installExtension("nativescript-cloud");
23+
}
24+
25+
public async canExecute(args: string[]): Promise<boolean> {
26+
return true;
27+
}
28+
}
29+
$injector.registerCommand("cloud|setup", CloudSetupCommand);

test/services/platform-environment-requirements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function createTestInjector() {
2626
return testInjector;
2727
}
2828

29-
describe.only("platformEnvironmentRequirements ", () => {
29+
describe("platformEnvironmentRequirements ", () => {
3030
describe("checkRequirements", () => {
3131
let testInjector: IInjector = null;
3232
let platformEnvironmentRequirements: IPlatformEnvironmentRequirements = null;

0 commit comments

Comments
 (0)