AlwaysKillSticky/util/package.php

24 lines
676 B
PHP

<?php
if ($argv[1] == "-b")
include_once("build-all.php");
$platforms = [
"chrome",
"firefox"
];
$root = preg_replace('/\/[^\/]+$/', '', dirname(__FILE__));
foreach ($platforms as $platform) {
$manifest = JSON_decode(file_get_contents("{$root}/build/{$platform}/manifest.json"), true);
$version = $manifest["version"];
$command = "cd {$root}/build/{$platform}; ";
$command .= "find . -type f -name '.DS_Store' -delete; ";
$command .= "mkdir -p {$root}/release; ";
$command .= "tar czf {$root}/release/AlwaysKillSticky-{$platform}-{$version}.tar.gz *; ";
$command .= "zip -r -FS {$root}/release/AlwaysKillSticky-{$platform}-{$version}.zip *";
`{$command}`;
}
?>