This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
executable file
·57 lines (52 loc) · 2.43 KB
/
cli.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
56
57
#!/usr/bin/env node
import meow from 'meow';
import createLaunchImages from './src/lib.js';
const cli = meow(`
Usage
$ create-launch-images <manifest-url>
Options
-o, --outputDir <directory> Output directory
-m, --maskable yes/no/auto Prefer maskable icons
-s, --square Disable squircle radius on icons
-f, --font Text font family
Example
$ create-launch-images https://airhorner.com/manifest.json
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)" href="/[email protected]">
<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" href="/[email protected]">
<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)" href="/[email protected]">
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3)" href="/[email protected]">
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)" href="/[email protected]">
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)" href="/[email protected]">
<link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)" href="/[email protected]">
<link rel="apple-touch-startup-image" media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)" href="/[email protected]">
<link rel="apple-touch-startup-image" media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)" href="/[email protected]">
`, {
importMeta: import.meta,
flags: {
outputDir: {
type: 'string',
shortFlag: 'o',
default: '.',
},
maskable: {
type: 'string',
shortFlag: 'm',
default: 'auto',
},
square: {
type: 'boolean',
shortFlag: 's',
default: false,
},
font: {
type: 'string',
shortFlag: 'f',
default: 'SF Pro Display',
},
},
});
if (cli.input[0] === undefined) {
cli.showHelp();
} else {
createLaunchImages(cli.input[0], cli.flags);
}