forked from gambitph/WP-OTF-Regenerate-Thumbnails
-
Notifications
You must be signed in to change notification settings - Fork 1
/
composer.json
43 lines (43 loc) · 2.08 KB
/
composer.json
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
{
"name": "gambitph/otf-regenerate-thumbnails",
"description": "Automatically regenerates your thumbnails on the fly when thumbnail sizes change.",
"keywords": ["thumbnail", "thumbnails", "resize", "regenerate", "automatic", "featured image", "feature image", "on the fly", "otf"],
"homepage" : "https://github.com/gambitph/WP-OTF-Regenerate-Thumbnails",
"license": "GPLv2+",
"authors": [
{
"name": "Gambit Technologies",
"email" : "[email protected]",
"homepage" : "http://www.titanframework.net/",
"role" : "Developer"
}
],
"type": "library",
"autoload": {
"files": ["otf_regen_thumbs.php"]
},
"archive": {
"exclude": [
"/bin",
"/vendor",
"/tests",
"/scss",
"/sass",
"*/composer.*",
"*/.*",
"*.dist",
"*.md",
"*.codekit",
"*.rb",
"*.scss",
"LICENSE",
"*.sh"
]
},
"scripts": {
"post-archive-cmd": [
"php -r \"\\$withVersion = false; \\$finalZip = basename( getcwd() ) . '.zip'; foreach ( array_merge(glob('*.php'), glob('*.css')) as \\$zipFile ) { \\$f = file_get_contents( \\$zipFile ); preg_match('/Plugin Name\\\\s*:\\\\s*([^\\\\n]+)/i', \\$f, \\$matches ); if (count(\\$matches) < 2) { preg_match('/Theme Name\\\\s*:\\\\s*([^\\\\n]+)/i', \\$f, \\$matches ); if (count(\\$matches) < 2) {continue;} } \\$name = \\$matches[1]; \\$zipName = trim(strtolower(str_replace(' ', '-', \\$name))); preg_match('/Version\\\\s*:\\\\s*([^\\\\n]+)/i', \\$f, \\$matches); if ( count(\\$matches) < 2 ){ continue;} \\$version = \\$matches[1]; \\$finalZip = \\$zipName . '-' . \\$version . '.zip'; if ( ! \\$withVersion ) { \\$finalZip = \\$zipName . '.zip'; } } foreach ( glob('*.zip') as \\$zipFile ) { rename( \\$zipFile, \\$finalZip ); break; }\"",
"php -r \"foreach ( glob('*.zip') as \\$zipFile ) { \\$dir = basename(\\$zipFile, '.zip'); exec( 'mkdir _tmp && mv ' . \\$zipFile . ' _tmp && cd _tmp && unzip ' . \\$zipFile . ' -d ' . \\$dir . ' && rm ' . \\$zipFile . ' && zip -r9 ' . \\$zipFile . ' ' . \\$dir . ' && mv *.zip .. && cd .. && rm -R _tmp' ); exec( 'mv ' . \\$zipFile . ' ..' ); } echo 'Created: ' . \\$zipFile . \\\"\\n\\\";\""
]
}
}