mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00
fix: correctly sanitize project name (#9193)
This commit is contained in:
@ -3,8 +3,14 @@ import { basename } from "path";
|
|||||||
import { INativeScriptPlatform } from "../helpers/platform";
|
import { INativeScriptPlatform } from "../helpers/platform";
|
||||||
import { getProjectRootPath } from "../helpers/project";
|
import { getProjectRootPath } from "../helpers/project";
|
||||||
|
|
||||||
|
function sanitizeName(appName: string): string {
|
||||||
|
const sanitizedName = appName.split("").filter((c) =>
|
||||||
|
/[a-zA-Z0-9]/.test(c)
|
||||||
|
).join("");
|
||||||
|
return sanitizedName;
|
||||||
|
}
|
||||||
function getDistPath() {
|
function getDistPath() {
|
||||||
const appName = basename(getProjectRootPath());
|
const appName = sanitizeName(basename(getProjectRootPath()));
|
||||||
return `platforms/ios/${appName}/app`;
|
return `platforms/ios/${appName}/app`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user