diff --git a/README-fr.md b/README-fr.md index b3a22c3..e8ac95c 100644 --- a/README-fr.md +++ b/README-fr.md @@ -184,6 +184,7 @@ Le script `package_check.sh` accepte 6 arguments en plus du package à tester. - `--bash-mode`: Rend le script autonome. Aucune intervention de l'utilisateur ne sera nécessaire. La valeur de auto_remove est ignorée. - `--branch=nom-de-branche`: Teste une branche du dépôt plutôt que de tester master. Permet de tester les pull request. + Vous pouvez utiliser une url avec une branche, https://github.com/YunoHost-Apps/APP_ynh/tree/my_branch, pour utiliser implicitement cet argument. - `--build-lxc`: Installe LXC et créer le conteneur debian Yunohost si nécessaire. - `--force-install-ok`: Force la réussite des installations, même si elles échouent. Permet d'effectuer les tests qui suivent même si l'installation a échouée. - `--interrupt`: Force l'option auto_remove à 0, le script marquera une pause avant chaque suppression d'application. diff --git a/README.md b/README.md index 947d06a..50098a8 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ The `package_check.sh` script accept 6 arguments in addition of the package to b - `--bash-mode`: The script will work without user intervention. auto_remove value is ignored - `--branch=branch-name`: Check a branch of the repository instead of master. Allow to check a pull request. + You can use an url with a branch, https://github.com/YunoHost-Apps/APP_ynh/tree/my_branch, to implicitly use this argument. - `--build-lxc`: Install LXC and create the Debian YunoHost container if necessary. - `--force-install-ok`: Force success of installations, even if they fail. Allow to perform following tests even if an installation fails. - `--interrupt`: Force auto_remove value, break before each remove. diff --git a/package_check.sh b/package_check.sh index 82e8c17..e5a7d44 100755 --- a/package_check.sh +++ b/package_check.sh @@ -490,6 +490,21 @@ fi echo "Pick up the package which will be tested." +# If the url is on a specific branch, extract the branch +if echo "$app_arg" | grep --quiet --extended-regexp "https?:\/\/.*\/tree\/" +then + gitbranch="-b ${app_arg##*/tree/}" + app_arg="${app_arg%%/tree/*}" +fi + +ECHO_FORMAT "Test the package $app_arg" "blue" "bold" +if [ -n "$gitbranch" ] +then + ECHO_FORMAT " on the branch ${gitbranch##-b }.\n" "blue" "bold" +else + ECHO_FORMAT ".\n" "blue" "bold" +fi + # Remove the previous package if it's still here. rm -rf "$script_dir"/*_check