Changeset View
Changeset View
Standalone View
Standalone View
scripts/celerity/generate_sprites.php
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| foreach ($sheets as $name => $sheet) { | foreach ($sheets as $name => $sheet) { | ||||
| $sheet->setBasePath($root); | $sheet->setBasePath($root); | ||||
| $manifest_path = $root.'/resources/sprite/manifest/'.$name.'.json'; | $manifest_path = $root.'/resources/sprite/manifest/'.$name.'.json'; | ||||
| if (!$args->getArg('force')) { | if (!$args->getArg('force')) { | ||||
| if (Filesystem::pathExists($manifest_path)) { | if (Filesystem::pathExists($manifest_path)) { | ||||
| $data = Filesystem::readFile($manifest_path); | $data = Filesystem::readFile($manifest_path); | ||||
| $data = json_decode($data, true); | $data = phutil_json_decode($data); | ||||
| if (!$sheet->needsRegeneration($data)) { | if (!$sheet->needsRegeneration($data)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| $sheet | $sheet | ||||
| ->generateCSS($webroot."/css/sprite-{$name}.css") | ->generateCSS($webroot."/css/sprite-{$name}.css") | ||||
| Show All 20 Lines | |||||