diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..5bae907 --- /dev/null +++ b/build.sh @@ -0,0 +1,12 @@ +echo "---" +echo "Создаём папку для сборки..." +echo "---" +mkdir -p build/wallet + +echo "---" +echo "Распаковываем и достаём файлы..." +echo "---" +tar -xvf *.tar.xz +bin_path="$(echo Cake_Wallet* | tr ' ' '\n' | grep -v '\.tar.\xz')" +chmod +x "${bin_path}/cake_wallet" +mv "${bin_path}"/* build/wallet/ diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..f798372 --- /dev/null +++ b/download.sh @@ -0,0 +1,12 @@ +echo "---" +echo "Скачивание бинарного файла..." +echo "---" +# Fetch the latest release information from the GitHub API +response=$(curl -s https://api.github.com/repos/cake-tech/cake_wallet/releases/latest) +# Extract the release tag and the desired file name +release_tag=$(echo "$response" | grep -o '"tag_name": "[^"]*' | sed 's/"tag_name": "//') +file_name="Cake_Wallet_${release_tag}_Linux.tar.xz" +# Construct the download link +download_link="https://github.com/cake-tech/cake_wallet/releases/download/$release_tag/$file_name" + +wget $download_link diff --git a/install_requirements.sh b/install_requirements.sh new file mode 100755 index 0000000..fcc25f2 --- /dev/null +++ b/install_requirements.sh @@ -0,0 +1,5 @@ +echo "Установите пакеты: flatpak-builder 7z" +read -p "Продолжить..." + +echo "Установка SDK..." +flatpak install flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 diff --git a/main.sh b/main.sh new file mode 100755 index 0000000..c8fa724 --- /dev/null +++ b/main.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +show_help() { + echo "$0 [down-only / build-only / install-only]" + echo "" + echo "down-only только скачать файл" + echo "build-only только построить пакет" + echo "install-only только установить пакет" + echo "clean очистка всех файлов сборки" + echo "uninstall удалить приложение" + exit 1 +} + +if [ "$#" == 0 ]; then + # INSTALL + ./install_requirements.sh + ./download.sh + ./install.sh +elif [ "$#" == 1 ]; then + arg=$1 + if [ $arg == "down-only" ]; then + ./download.sh + elif [ $arg == "build-only" ]; then + ./build.sh + elif [ $arg == "install-only" ]; then + ./install.sh + elif [ $arg == "clean" ]; then + ./clean.sh + elif [ $arg == "uninstall" ]; then + ./uninstall.sh + else + show_help + fi +else + show_help +fi