From 27489fc77cfd9c446ead06a596f93a2b701f3c3a Mon Sep 17 00:00:00 2001 From: xpamych Date: Sun, 21 May 2023 12:02:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D1=89=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hlna-git/lure.sh | 14 ++++++-------- hlna-git/postinstall.sh | 27 --------------------------- hlna-git/postremove.sh | 26 -------------------------- 3 files changed, 6 insertions(+), 61 deletions(-) delete mode 100644 hlna-git/postinstall.sh delete mode 100644 hlna-git/postremove.sh diff --git a/hlna-git/lure.sh b/hlna-git/lure.sh index 232ade3..32173e8 100644 --- a/hlna-git/lure.sh +++ b/hlna-git/lure.sh @@ -21,18 +21,16 @@ version() { git-version } -scripts=( - ['postinstall']='postinstall.sh' - ['postremove']='postremove.sh' -) - prepare() { pip3 install --upgrade --user click colorama click_completion pyTelegramBotAPI discord pip3 install --upgrade rcon } package() { - install -Dm755 "${srcdir}/hln-a/hlna.py" "${pkgdir}/usr/bin/hlna.py" - install -Dm755 "${srcdir}/hln-a/hlna_bot.py" "${pkgdir}/usr/bin/hlna-bot.py" - install -Dm644 "${srcdir}/hln-a/LICENSE.md" "${pkgdir}/usr/share/licenses/hlna/license" + install -Dm755 "${srcdir}/hln-a/hlna.py" "${pkgdir}/home/${SUDO_USER}/.local/share/hlna/hlna.py" + install -Dm755 "${srcdir}/hln-a/hlnaui.py" "${pkgdir}/home/${SUDO_USER}/.local/share/hlna/hlnaui.py" + install -Dm755 "${srcdir}/hln-a/hlna_discord_bot.py" "${pkgdir}/home/${SUDO_USER}/.local/share/hlna/hlnabot.py" + install-license ./LICENSE.md /hlna/LICENSE + ln -s "${pkgdir}/home/${SUDO_USER}/.local/share/hlna/hlna.py" "${pkgdir}/usr/bin/hlna" + ln -s "${pkgdir}/home/${SUDO_USER}/.local/share/hlna/hlnabot.py" "${pkgdir}/usr/bin/hlnabot" } diff --git a/hlna-git/postinstall.sh b/hlna-git/postinstall.sh deleted file mode 100644 index 260db4b..0000000 --- a/hlna-git/postinstall.sh +++ /dev/null @@ -1,27 +0,0 @@ -line1_to_add='alias hlna="hlna.py"' -line2_to_add='alias hlna-bot="hlna-bot.py"' -file_paths=("/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish") - -for file_path in "${file_paths[@]}"; do - if [ -f "$file_path" ]; then - # Check if the lines are already in the file - grep -qF "$line1_to_add" "$file_path" - if [ $? -ne 0 ]; then - echo "$line1_to_add" >>"$file_path" - echo "Alias hlna добавлен в $file_path" - else - echo "Alias hlna уже есть в файле $file_path" - fi - - grep -qF "$line2_to_add" "$file_path" - if [ $? -ne 0 ]; then - echo "$line2_to_add" >>"$file_path" - echo "Alias hlna-bot добавлен в $file_path" - else - echo "Alias hlna-bot уже есть в файле $file_path" - fi - - else - echo "$file_path не существует" - fi -done diff --git a/hlna-git/postremove.sh b/hlna-git/postremove.sh deleted file mode 100644 index f4bfb90..0000000 --- a/hlna-git/postremove.sh +++ /dev/null @@ -1,26 +0,0 @@ -line1_to_remove='alias hlna="hlna.py"' -line2_to_remove='alias hlna-bot="hlna-bot.py"' -file_paths=("/home/$SUDO_USER/.zshrc" "/home/$SUDO_USER/.bashrc" "/home/$SUDO_USER/.config/fish/config.fish") - -for file_path in "${file_paths[@]}"; do - if [ -f "$file_path" ]; then - # Check if the line is in the file - grep -qF "$line1_to_remove" "$file_path" - if [ $? -eq 0 ]; then - sed -i "/$line1_to_remove/d" "$file_path" - echo "Alias hlna удалён из $file_path" - else - echo "Alias hlna нет в $file_path" - fi - - grep -qF "$line2_to_remove" "$file_path" - if [ $? -eq 0 ]; then - sed -i "/$line2_to_remove/d" "$file_path" - echo "Alias hlna-bot удалён из $file_path" - else - echo "Alias hlna-bot нет в $file_path" - fi - else - echo "$file_path не существует" - fi -done