Skip to content

Commit 56ccba4

Browse files
committed
fix: android install script
1 parent 1145316 commit 56ccba4

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

docs/senpcli-guide.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ pip install senpwai
2020

2121
- **Android (Using [termux](https://github.com/termux/termux-app), note that the android port is currently really buggy and barely even works)**
2222

23-
***CURRENTLY BROKEN !!!***
24-
2523
```sh
2624
pkg update -y && curl https://raw.githubusercontent.com/SenZmaKi/Senpwai/master/termux/install.sh | bash
2725
```

termux/install.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,38 @@ set -e
55
echo -e "\033[0;32mUpdating pkg\033[0m"
66
pkg update -y
77

8-
echo -e "\033[0;32mInstalling python 3.11\033[0m"
9-
pkg install python=3.11.* -y
8+
echo -e "\033[0;32mInstalling python\033[0m"
9+
pkg install python -y
1010

1111
echo -e "\033[0;32mInstalling git\033[0m"
1212
pkg install git -y
1313

14-
SENPWAI_DIR=$PREFIX/share/Senpwai
14+
SENPWAI_DIR="$PREFIX/share/Senpwai"
1515
echo -e "\033[0;32mCloning repository to $SENPWAI_DIR\033[0m"
16-
rm -rf $SENPWAI_DIR
17-
git clone https://github.com/SenZmaKi/Senpwai --depth 1 $SENPWAI_DIR
18-
cd $SENPWAI_DIR
16+
rm -rf "$SENPWAI_DIR"
17+
git clone https://github.com/SenZmaKi/Senpwai --depth 1 "$SENPWAI_DIR"
18+
cd "$SENPWAI_DIR"
1919

2020
echo -e "\033[0;32mCreating virtual environment, this may take a while\033[0m"
21-
python3 -m venv .venv
21+
python -m venv .venv
2222

2323
echo -e "\033[0;32mActivating virtual environment\033[0m"
2424
source .venv/bin/activate
2525

2626
echo -e "\033[0;32mInstalling python-cryptography\033[0m"
27+
PYTHON_VERSION=$(python -V | cut -d' ' -f2 | cut -d'.' --complement -f3)
2728
apt download python-cryptography
28-
dpkg -x python-cryptography_* $PREFIX/tmp
29-
mv $PREFIX/tmp${PREFIX}/lib/python3.11/site-packages/* .venv/lib/python3.11/site-packages
29+
dpkg -x python-cryptography_*.deb "$PREFIX/tmp"
30+
mv "$PREFIX"/tmp"${PREFIX}"/lib/python"${PYTHON_VERSION}"/site-packages/* .venv/lib/python"${PYTHON_VERSION}"/site-packages
3031

3132
echo -e "\033[0;32mInstalling dependencies\033[0m"
3233
pip install -r termux/requirements.txt
3334

34-
SENPCLI_SH_PATH=$SENPWAI_DIR/termux/senpcli.sh
35-
SENPCLI_BIN_PATH=$PREFIX/bin/senpcli
35+
SENPCLI_SH_PATH="$SENPWAI_DIR/termux/senpcli.sh"
36+
SENPCLI_BIN_PATH="$PREFIX/bin/senpcli"
3637
echo -e "\033[0;32mSetting up senpcli\033[0m"
37-
chmod +x $SENPCLI_SH_PATH
38-
mv $SENPCLI_SH_PATH $SENPCLI_BIN_PATH
38+
chmod +x "$SENPCLI_SH_PATH"
39+
mv "$SENPCLI_SH_PATH" "$SENPCLI_BIN_PATH"
3940

4041
echo ""
4142
echo -e "\033[0;32mInstallation complete\033[0m"

0 commit comments

Comments
 (0)