forked from zoontek/react-native-bootsplash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact-native.config.js
More file actions
54 lines (51 loc) · 1.49 KB
/
Copy pathreact-native.config.js
File metadata and controls
54 lines (51 loc) · 1.49 KB
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
const path = require("path");
const { generate } = require("./dist/commonjs/generate");
module.exports = {
commands: [
{
name: "generate-bootsplash <logoPath>",
description: "Generate a launch screen using an original logo file",
options: [
{
name: "--background-color <color>",
description:
"color used as launch screen background (in hexadecimal format)",
default: "#fff",
},
{
name: "--logo-width <width>",
description:
"logo width at @1x (in dp - we recommand approximately ~100)",
default: 100,
parse: (value) => parseInt(value, 10),
},
{
name: "--assets-path [path]",
description:
"path to your static assets directory (useful to require the logo file in JS)",
},
],
func: (
[logoPath],
{ project: { android, ios } },
{ backgroundColor, logoWidth, assetsPath },
) => {
const workingDirectory =
process.env.INIT_CWD || process.env.PWD || process.cwd();
return generate({
android,
ios,
workingDirectory,
logoPath: path.resolve(workingDirectory, logoPath),
backgroundColor,
logoWidth,
assetsPath: assetsPath
? path.resolve(workingDirectory, assetsPath)
: undefined,
}).catch((error) => {
console.error(error);
});
},
},
],
};