Skip to content

Commit 6b10b29

Browse files
committed
(tweak) Use latest tag, not commit
1 parent 8bb4157 commit 6b10b29

File tree

2 files changed

+32
-27
lines changed

2 files changed

+32
-27
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ Project Babble is an open-source mouth tracking project designed to work with an
2121
Head to the releases section and [download the latest installer](https://github.com/Project-Babble/ProjectBabble/releases/latest).
2222

2323
### Linux
24-
Copy, paste and run the following script into the terminal of your choice:
24+
Install `git`, `curl` and a version of `python` greater than `3.8` for your distro.
25+
26+
Then, copy paste and run the following script into the terminal of your choice:
2527

2628
```bash
27-
bash -c "$(curl -fsSL https://gist.githubusercontent.com/dfgHiatus/a92a3caae24c1bfab1c7544537a654c5/raw/494a4bc5ed6c97745c7a283661d2f5530ba3d949/project-babble-install.sh)"
29+
bash -c "$(curl -fsSL https://gist.githubusercontent.com/dfgHiatus/a92a3caae24c1bfab1c7544537a654c5/raw/928904dfacfc193233ba842d0d137ec5874beac7/project-babble-install.sh)"
2830
```
2931

3032
Once it's finished installing, you can update and run the Babble app by typing `babble-app` into your terminal.

babbleapp.sh

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,44 @@ install_dir="$HOME/.local/share/project-babble"
2424

2525
# Function to install requirements
2626
install_requirements() {
27+
cd $install_dir
28+
cd BabbleApp
29+
echo "Installing requirements..."
2730
# Create a temporary requirements file without the Windows-only package
2831
grep -v "onnxruntime-directml" requirements.txt > linux_requirements.txt
2932
pip install -r linux_requirements.txt --quiet
3033
rm linux_requirements.txt
3134
}
3235

33-
# Function to update the repository
34-
update_repo() {
35-
echo "Checking for updates..."
36-
git fetch
37-
if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then
38-
echo "Updates found. Pulling changes..."
39-
git pull
40-
echo "Updating dependencies..."
41-
source venv/bin/activate
42-
install_requirements
43-
deactivate
44-
45-
# Add babbleapp.sh to PATH
46-
mkdir -p "$HOME/.local/bin"
47-
ln -s "$install_dir/babbleapp.sh" "$HOME/.local/bin/babble-app"
48-
chmod +x "$HOME/.local/bin/babble-app"
49-
50-
# Add ~/.local/bin to PATH if not already present
51-
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
52-
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc"
53-
echo "Please restart your terminal or run 'source ~/.bashrc' to update your PATH."
54-
fi
36+
# Function to get the latest release tag
37+
get_latest_tag() {
38+
git fetch --tags
39+
git describe --tags --abbrev=0
40+
}
5541

56-
echo "Project Babble has been updated successfully!"
57-
else
58-
echo "Project Babble is already up to date."
42+
# Function to update the repository
43+
update_repo() {
44+
echo "Checking for updates..."
45+
git fetch --tags
46+
local_tag=$(git describe --tags --abbrev=0)
47+
remote_tag=$(git describe --tags --abbrev=0 origin/main)
48+
49+
if [ "$local_tag" != "$remote_tag" ]; then
50+
echo "New version available: $remote_tag"
51+
echo "Current version: $local_tag"
52+
echo "Updating to the latest version..."
53+
git checkout "$remote_tag"
54+
echo "Updating dependencies..."
55+
source venv/bin/activate
56+
install_requirements
57+
deactivate
58+
echo "Project Babble has been updated successfully to version $remote_tag!"
59+
else
60+
echo "Project Babble is already at the latest version: $local_tag"
5961
fi
6062
}
6163

64+
6265
cd $install_dir
6366
update_repo
6467
source venv/bin/activate

0 commit comments

Comments
 (0)