-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathios.ts
More file actions
25 lines (21 loc) · 882 Bytes
/
ios.ts
File metadata and controls
25 lines (21 loc) · 882 Bytes
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
import { basename } from "path";
import { INativeScriptPlatform } from "../helpers/platform";
import { getProjectRootPath } from "../helpers/project";
import { env } from '../';
import { getValue } from '../helpers/config';
function sanitizeName(appName: string): string {
return appName.split("").filter((c) =>
/[a-zA-Z0-9]/.test(c)
).join("");
}
function getDistPath() {
// if nativescript.config projectName is defined, use that custom name
// otherwise, default to base project directory name for project name
const appName = getValue('projectName') ?? sanitizeName(basename(getProjectRootPath()));
const platform = process.env.USER_PROJECT_PLATFORMS_IOS ? process.env.USER_PROJECT_PLATFORMS_IOS : `${env.buildPath ?? "platforms"}/ios`;
return `${platform}/${appName}/app`;
}
const iOSPlatform: INativeScriptPlatform = {
getDistPath,
}
export default iOSPlatform;