Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 089848b

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #321 from telerik/fatme/cherrypick-commits-1.0.1
Cherrypick commits for ns 1.0.1 release
2 parents 90d79b2 + 09a51e1 commit 089848b

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

declarations.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ interface ISpawnFromEventOptions {
172172
interface IProjectHelper {
173173
projectDir: string;
174174
generateDefaultAppId(appName: string, baseAppId: string): string;
175+
sanitizeName(appName: string): string;
175176
}
176177

177178
interface IPropertiesParser {

definitions/mobile.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ declare module Mobile {
250250
stderrFilePath?: string;
251251
stdoutFilePath?: string;
252252
appId?: string;
253+
args?: string
253254
}
254255

255256
interface IPlatformsCapabilities {

mobile/ios/ios-emulator-services.ts

+4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ class IosEmulatorServices implements Mobile.IEmulatorPlatformServices {
8585
opts = opts.concat("--device", options.device);
8686
}
8787

88+
if (emulatorOptions.args) {
89+
opts.push(util.format("--args=\"%s\"", emulatorOptions.args));
90+
}
91+
8892
this.$childProcess.spawn(nodeCommandName, opts, { stdio: "inherit" });
8993
}
9094
}

project-helper.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class ProjectHelper implements IProjectHelper {
3939
}
4040

4141
public generateDefaultAppId(appName: string, baseAppId: string): string {
42-
var sanitizedName = _.filter(appName.split(""), (c) => /[a-zA-Z0-9]/.test(c)).join("");
42+
var sanitizedName = this.sanitizeName(appName);
4343
if (sanitizedName) {
4444
if (/^\d+$/.test(sanitizedName)) {
4545
sanitizedName = "the" + sanitizedName;
@@ -50,5 +50,10 @@ export class ProjectHelper implements IProjectHelper {
5050

5151
return util.format("%s.%s", baseAppId, sanitizedName);
5252
}
53+
54+
public sanitizeName(appName: string): string {
55+
var sanitizedName = _.filter(appName.split(""), (c) => /[a-zA-Z0-9]/.test(c)).join("");
56+
return sanitizedName;
57+
}
5358
}
5459
$injector.register("projectHelper", ProjectHelper);

0 commit comments

Comments
 (0)