Skip to content

Commit

Permalink
annonce update
Browse files Browse the repository at this point in the history
  • Loading branch information
Spishous committed Mar 22, 2022
1 parent 5968d32 commit 318418c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions spish.phar
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
define("GIT","Spishous/SpishCLI");
define("VERSION","1.0.4");
define("VERSION","1.0.5");
define("FOLDER", getcwd());
define("CLI", dirname(__FILE__));
define("ARGV", $argv);
Expand All @@ -13,7 +13,7 @@ class main extends command{
case "-v":
case "-V":
case "-version":
$this->version();
$this->version()->newUpdatePublish();
break;
case "help":
$this->help();
Expand Down Expand Up @@ -172,6 +172,12 @@ class gitInfo extends script_object{
$json=$this->getInfoUpdate();
return str_replace(" ","-",$json["name"])??"";
}
public function newUpdatePublish(){
$lastV=$this->getLastVersion();
if(VERSION<$lastV){
$this->newline()->printStyle("Release ".$lastV." disponible","brown")->newline();
}
}
private function getInfoUpdate(){
$url="https://api.github.com/repos/".GIT."/releases/latest";
$ua="node.js";
Expand All @@ -189,6 +195,7 @@ class gitInfo extends script_object{
class command extends gitInfo{
public function version(){
$this->print("current version ")->printStyle(VERSION,"green","",true);
return $this;
}
public function help(){
$this->newline()->printStyle(" LISTE DES COMMANDES ","black","yellow")->newline()->newline();
Expand Down Expand Up @@ -272,7 +279,7 @@ class update extends gitInfo{
$this->printStyle("Votre possedez deja la version la plus recente","brown")->print(" (".VERSION.")");
return true;
}else{
$this->printStyle("Release ".$lastV." disponible","brown")->newline()->printStyle(" Mise a jour en cours..","yellow");
$this->newUpdatePublish()->newline()->printStyle(" Mise a jour en cours..","yellow");
$this->newline()->printStyle(" Telechargement..","yellow");
if(!$this->downloadUpdate($lastV)){
return false;
Expand Down

0 comments on commit 318418c

Please sign in to comment.