Explorar o código

Improved make-release.php

Edgard %!s(int64=5) %!d(string=hai) anos
pai
achega
e594a53626
Modificáronse 2 ficheiros con 6 adicións e 3 borrados
  1. 1 0
      composer.json
  2. 5 3
      tools/make-release.php

+ 1 - 0
composer.json

@@ -8,6 +8,7 @@
     "scripts": {
         "lint": "phpcs",
         "lint:fix": "phpcbf",
+        "make-release": "@php tools/make-release.php",
         "update-locales": "@php tools/update-locales.php"
     },
     "config": {

+ 5 - 3
tools/make-release.php

@@ -34,7 +34,7 @@ if (!function_exists('glob_recursive')) {
 
 $dir = dirname(dirname(__FILE__));
 
-$tmp_dir = "/tmp/singlesignon";
+$tmp_dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . "singlesignon/";
 
 echo "Delete old release\n";
 remove_recursive("$dir/singlesignon.zip");
@@ -50,8 +50,8 @@ if (file_exists($tmp_dir)) {
 
 sleep(1);
 
-echo "Copy to  /tmp directory\n";
-log_and_exec("git checkout-index -a -f --prefix=/tmp/singlesignon/");
+echo "Copy to $tmp_dir\n";
+log_and_exec("git checkout-index -a -f --prefix=" . $tmp_dir);
 
 chdir($tmp_dir);
 
@@ -112,3 +112,5 @@ foreach ($files as $f) {
 
 $zip->close();
 $tar->compress(Phar::GZ);
+
+remove_recursive("$dir/singlesignon.tar");