mirror of
https://github.com/spitkov/ynsrepo.git
synced 2025-01-18 04:24:38 +01:00
remove sample files add ayva
This commit is contained in:
parent
079e4c4aa1
commit
e284932662
12 changed files with 153 additions and 23 deletions
1
packages/ayva/VERSION
Normal file
1
packages/ayva/VERSION
Normal file
|
@ -0,0 +1 @@
|
|||
1.0
|
62
packages/ayva/install.sh
Normal file
62
packages/ayva/install.sh
Normal file
|
@ -0,0 +1,62 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Exit script on any error
|
||||
set -e
|
||||
|
||||
echo "Starting installation..."
|
||||
|
||||
# Ensure git and python3-pip are installed
|
||||
if ! command -v git &> /dev/null; then
|
||||
echo "Git is not installed. Please install Git and rerun this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v python3 &> /dev/null; then
|
||||
echo "Python3 is not installed. Please install Python3 and rerun this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v pip3 &> /dev/null; then
|
||||
echo "pip3 is not installed. Please install pip3 and rerun this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Variables
|
||||
REPO_URL="https://github.com/maybe-asdf/yaergu-ayva/"
|
||||
DEST_DIR="$HOME/yaergu-ayva"
|
||||
HIDDEN_DIR="$HOME/.ayva"
|
||||
DESKTOP_FILE="ayva.desktop"
|
||||
APPLICATIONS_DIR="$HOME/.local/share/applications"
|
||||
BINARY_PATH="/usr/bin/ayva"
|
||||
VENV_DIR="$HIDDEN_DIR/venv"
|
||||
|
||||
# Clone the repository
|
||||
echo "Cloning repository into $HOME..."
|
||||
git clone "$REPO_URL" "$DEST_DIR"
|
||||
|
||||
# Move the desktop file
|
||||
echo "Moving $DESKTOP_FILE to $APPLICATIONS_DIR..."
|
||||
mkdir -p "$APPLICATIONS_DIR"
|
||||
mv "$DEST_DIR/$DESKTOP_FILE" "$APPLICATIONS_DIR"
|
||||
|
||||
# Move the binary file
|
||||
echo "Making ayva usable..."
|
||||
sudo mv "$DEST_DIR/ayva" "$BINARY_PATH"
|
||||
|
||||
# Rename the repository folder
|
||||
echo "Renaming $DEST_DIR to $HIDDEN_DIR..."
|
||||
mv "$DEST_DIR" "$HIDDEN_DIR"
|
||||
|
||||
# Create virtual environment
|
||||
echo "Creating virtual environment..."
|
||||
python3 -m venv "$VENV_DIR"
|
||||
|
||||
# Activate virtual environment and install packages
|
||||
echo "Installing dependencies..."
|
||||
source "$VENV_DIR/bin/activate"
|
||||
pip install vosk pyaudio
|
||||
|
||||
# Deactivate the virtual environment
|
||||
deactivate
|
||||
|
||||
exit 0
|
39
packages/ayva/remove.sh
Normal file
39
packages/ayva/remove.sh
Normal file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Exit script on any error
|
||||
set -e
|
||||
|
||||
echo "Starting uninstallation..."
|
||||
|
||||
# Variables
|
||||
REPO_URL="https://github.com/maybe-asdf/yaergu-ayva/"
|
||||
DEST_DIR="$HOME/yaergu-ayva"
|
||||
HIDDEN_DIR="$HOME/.ayva"
|
||||
DESKTOP_FILE="ayva.desktop"
|
||||
APPLICATIONS_DIR="$HOME/.local/share/applications"
|
||||
BINARY_PATH="/usr/bin/ayva"
|
||||
VENV_DIR="$HIDDEN_DIR/venv"
|
||||
|
||||
# Remove the binary file
|
||||
echo "Removing the ayva binary from $BINARY_PATH..."
|
||||
sudo rm -f "$BINARY_PATH"
|
||||
|
||||
# Remove the desktop file
|
||||
echo "Removing $DESKTOP_FILE from $APPLICATIONS_DIR..."
|
||||
rm -f "$APPLICATIONS_DIR/$DESKTOP_FILE"
|
||||
|
||||
# Remove the virtual environment
|
||||
echo "Removing virtual environment at $VENV_DIR..."
|
||||
rm -rf "$VENV_DIR"
|
||||
|
||||
# Remove the repository folder
|
||||
echo "Removing $HIDDEN_DIR directory..."
|
||||
rm -rf "$HIDDEN_DIR"
|
||||
|
||||
# Optionally, you can remove the repository clone directory if it exists
|
||||
if [ -d "$DEST_DIR" ]; then
|
||||
echo "Removing $DEST_DIR directory..."
|
||||
rm -rf "$DEST_DIR"
|
||||
fi
|
||||
|
||||
exit 0
|
51
packages/ayva/update.sh
Normal file
51
packages/ayva/update.sh
Normal file
|
@ -0,0 +1,51 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Exit script on any error
|
||||
set -e
|
||||
|
||||
echo "Starting update..."
|
||||
|
||||
# Variables
|
||||
REPO_URL="https://github.com/maybe-asdf/yaergu-ayva/"
|
||||
DEST_DIR="$HOME/yaergu-ayva"
|
||||
HIDDEN_DIR="$HOME/.ayva"
|
||||
DESKTOP_FILE="ayva.desktop"
|
||||
APPLICATIONS_DIR="$HOME/.local/share/applications"
|
||||
BINARY_PATH="/usr/bin/ayva"
|
||||
VENV_DIR="$HIDDEN_DIR/venv"
|
||||
|
||||
# Check if the repository directory exists
|
||||
if [ ! -d "$HIDDEN_DIR" ]; then
|
||||
echo "The repository directory does not exist. Please install the software first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Navigate to the hidden repository directory
|
||||
cd "$HIDDEN_DIR"
|
||||
|
||||
# Pull the latest changes from the repository (without checking for changes)
|
||||
echo "Pulling latest changes from the repository..."
|
||||
git pull origin main
|
||||
|
||||
# Reinstall dependencies in the virtual environment
|
||||
echo "Reinstalling dependencies..."
|
||||
source "$VENV_DIR/bin/activate"
|
||||
pip install --upgrade vosk pyaudio
|
||||
|
||||
# Rebuild or refresh the binary if necessary
|
||||
if [ -f "$DEST_DIR/ayva" ]; then
|
||||
echo "Reinstalling the ayva binary..."
|
||||
sudo mv -f "$DEST_DIR/ayva" "$BINARY_PATH"
|
||||
else
|
||||
echo "No ayva binary found, skipping installation."
|
||||
fi
|
||||
|
||||
# Update the desktop entry (if any change is detected)
|
||||
if [ -f "$DEST_DIR/$DESKTOP_FILE" ]; then
|
||||
echo "Updating desktop entry..."
|
||||
mv -f "$DEST_DIR/$DESKTOP_FILE" "$APPLICATIONS_DIR"
|
||||
else
|
||||
echo "No changes detected for the desktop entry."
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1 +0,0 @@
|
|||
1.1
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Installing calc package..."
|
||||
# Add installation logic here
|
||||
exit 0
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Removing calc package..."
|
||||
# Add removal logic here
|
||||
exit 0
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Updating calc package..."
|
||||
# Add update logic here
|
||||
exit 0
|
|
@ -1 +0,0 @@
|
|||
2.0
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/bash
|
||||
echo 1
|
||||
exit 1
|
|
@ -1 +0,0 @@
|
|||
#!/bin/bash
|
|
@ -1,2 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
Loading…
Reference in a new issue