From 0d06ef4ead92862b2992377843bc6b794063da1c Mon Sep 17 00:00:00 2001 From: Kubat <mael.martin31@gmail.com> Date: Wed, 2 Dec 2020 15:12:40 +0100 Subject: [PATCH] Update readme and delete no more necessary install script --- README.md | 13 +++++++----- install.sh | 60 ------------------------------------------------------ 2 files changed, 8 insertions(+), 65 deletions(-) delete mode 100755 install.sh diff --git a/README.md b/README.md index bf9e90b..3bd9947 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Salon d'aide : `##sticker:iiens.net` - [Avoir un meilleur stickerpicker](#user-content-avoir-un-meilleur-stickerpicker) - [Utiliser un pack de sticker du dépôt](#user-content-utiliser-un-pack-de-sticker) - [Créer des packs de stickers](#user-content-créer-des-packs-de-stickers) +- [Utilisation de stpkg](#utilisation-de-stpkg) ## Utiliser le stickerpicker d'un ami Si vous avez des amis ayant déjà leur propre stickerpicker, il est possible de le réutiliser. @@ -54,10 +55,10 @@ Pour cela: ```bash git clone https://git.iiens.net/Tigriz/matrix-stickers.git ``` -3. Se déplacer dans le dépôt et exécuter le script install.sh +3. Se déplacer dans le dépôt et exécuter le script `stpkg` ```bash cd matrix-stickers - ./install.sh + ./stpkg --install ``` 4. Se connecter à Element. Utiliser la commande `/devtools` dans n'importe quel tchat.  @@ -200,13 +201,15 @@ La commande `stpkg` a besoin des executables `egrep` (ou `grep` si indisponible) `sponge` et `jq`. Il faut donc les installer ou les recompiler sur votre machine (`apt install moreutils jq grep`). -> Il faut avoir utiliser le script `install.sh` et bien mettre les variables +> Il faut avoir utiliser le script `stpkg` et bien mettre les variables `STPKG_BASE` et `STPKG_INSTALL` dans votre bashrc pour que `stpkg` fonctionne. -After using the `install.sh` script you can place the `stpkg` script in your path. +Après avoir utilisé `stpkg --install`, vous pouvez placer le script `stpkg` +dans votre path ou créer un alias pour l'exécuter facilement. Les commandes de `stpkg` : +- `stpkg --install [dossier d'installation]` - `stpkg update` -- `stpkg list [-e -p -np] [bash regex]` +- `stpkg list [-e -p -np] [regex bash]` - `stpkg add <pack>` - `stpkg del <pack>` diff --git a/install.sh b/install.sh deleted file mode 100755 index 8d08083..0000000 --- a/install.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -BASE_DIR="$PWD" - -die() { - error $* - cd $PWD # Go to initial directory - exit 1 -} - -error() { echo -ne '\e[31m'$*'\e[39m\n'; } -warn() { echo -ne '\e[33m'$*'\e[39m\n'; } -info() { echo -ne '\e[32m'$*'\e[39m\n'; } - -# Clone the stickerpicker into the html repository -cd ~/html >/dev/null 2>&1 \ - || warn "Could not cd to '~/html', will clone to '$PWD/stickerpicker'" - -if [ -d stickerpicker ]; then - # Fetch & rebase => update - info "The stickerpicker is already installed, update it" - LOCATION_OPT='--git-dir=stickerpicker/.git --work-tree=stickerpicker' - git $LOCATION_OPT fetch || die "Failed to fetch from sticker repo" - git $LOCATION_OPT rebase || die "Faield to rebase... what did you do to your master branch?" -else - # Install - info "The stickerpicker is not installed, install it to $PWD/stickerpicker" - git clone https://github.com/maunium/stickerpicker.git stickerpicker \ - || die "Failed to git clone the stickerpicker project." \ - "If you already installed stickerpicker, remove it or use the 'stpkg' command" -fi - -# Initialize the stickerpicker with the pack -# scalar-privacy_pam.json -cd stickerpicker || die "Could not cd to '$PWD/stickerpicker'" -cp packs/* web/packs || die "Failed to cp packs to '$PWD/web/packs'" -cd web/packs || die "Failed to cd to '$PWD/web/packs'" - -cat > index.json << EOF -{ - "homeserver_url": "https://matrix.iiens.net", - "packs": [ - "scalar-privacy_pam.json" - ] -} -EOF - -[ ! -f index.json ] && die "Failed to create the $PWD/index.json file" - -info "Created index.json in '$PWD'" - -STPKG_BASE=$BASE_DIR -STPKG_INSTALL=`realpath $PWD/../../` - -info 'You may add the following lines in your bashrc file:' -echo "export STPKG_INSTALL='$STPKG_INSTALL'" -echo "export STPKG_BASE='$STPKG_BASE'" - -# Go to initial directory -cd $BASE_DIR -- GitLab