This commit is contained in:
justuser 2024-12-14 10:20:05 +03:00
parent d9a1162e94
commit 67414b302d
4 changed files with 65 additions and 0 deletions

12
build.sh Executable file
View File

@ -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/

12
download.sh Executable file
View File

@ -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

5
install_requirements.sh Executable file
View File

@ -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

36
main.sh Executable file
View File

@ -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