diff --git a/README.md b/README.md index d538cc5..bc312dd 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,18 @@ # TLauncher -This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/), but i didn't figure it out yet how to update TLauncher. +This is a repo that i made to install TLauncher on Arch Linux directly from their [site](https://tlauncher.org/). ## How to install -1. -```c -chmod +x ./install.sh -``` -2. -```c -./install.sh -``` \ No newline at end of file +1. Change the permissions of the script + ```c + chmod +x ./install.sh + ``` +2. Install tlauncher + ```c + ./install.sh + ``` + +## Usage +After the installation, you can just type `tlauncher` in the terminal to launch tlauncher. + +If you wanna update type `tlauncher --update` or `tlauncher -u`, for downloading the last version of tlauncher _(It's not the best way of doing this, but it will do it for now)_. \ No newline at end of file diff --git a/src/tlauncher b/src/tlauncher index 9dcd615..d6f78b6 100755 --- a/src/tlauncher +++ b/src/tlauncher @@ -1,2 +1,22 @@ #!/bin/bash -java -jar /usr/share/tlauncher/tlauncher.jar + +function update() { + wget https://tlauncher.org/jar -P /tmp + unzip /tmp/jar -d /tmp/tlauncher + sudo mv /tmp/tlauncher/*.jar /usr/share/tlauncher/tlauncher.jar + rm /tmp/jar + rm -rf /tmp/tlauncher/ +} + + +while [[ "$1" ]]; do + case "$1" in + "--update" | "-u") + update + ;; + *) + java -jar /usr/share/tlauncher/tlauncher.jar + ;; + esac + shift +done \ No newline at end of file