-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
55 lines (50 loc) · 1.37 KB
/
index.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env node
const shelljs = require("shelljs");
const fs = require("fs");
const prompts = require("prompts");
let options = [
{
title: "Basic Javascript Setup",
value: "solito-universal-app-template-nativebase",
},
{
title: "With Typescript Setup",
value: "solito-universal-app-template-nativebase-typescript",
},
];
let promptsConfig = [
{
type: "select",
name: "value",
message: "Pick your template",
choices: options,
initial: 0,
},
];
function main() {
shelljs.exec(
"git clone https://github.com/GeekyAnts/nativebase-templates.git"
);
shelljs.cd("nativebase-templates");
(async () => {
const response = await prompts(promptsConfig);
shelljs.exec(
`cp -Rf ./${response.value} ../${response.value}`,
function (err) {
console.log(err);
}
);
shelljs.exec(
`cd ../${response.value} && npm install && cd apps/expo && npm install && cd ../next && npm install && cd ../../packages/app && npm install && cd ../.. && npm install`
);
shelljs.exec(`cd .. && rm -rf nativebase-templates`);
console.log("To start with your project, run: ");
console.log("cd " + response.value);
console.log("yarn web or npm run web");
console.log("yarn native or npm run native");
console.log("Setup Done, Happy Coding!");
})();
}
if (require.main === module) {
main();
}