fix: save install dir before cd and use absolute path for setup.py
wo_install() does cd to HOME before checking for setup.py, so ./setup.py was always checking /root/setup.py (doesn't exist) instead of /root/WPIQ/setup.py. Save pwd at script start and reference it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
20
install
20
install
@@ -552,9 +552,10 @@ wo_install() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f ./setup.py ]; then
|
||||
/opt/wo/bin/pip install --force-reinstall --no-cache-dir --no-deps . 2>/dev/null
|
||||
/opt/wo/bin/pip install . --upgrade-strategy=eager
|
||||
if [ -f "$wo_install_dir/setup.py" ]; then
|
||||
cd "$wo_install_dir" || exit 1
|
||||
/opt/wo/bin/pip install --force-reinstall --no-cache-dir --no-deps .
|
||||
cd || exit 1
|
||||
elif [ "$wo_branch" = "master" ]; then
|
||||
/opt/wo/bin/pip install -U wordops --upgrade-strategy=eager
|
||||
else
|
||||
@@ -581,10 +582,10 @@ wo_travis_install() {
|
||||
wo_distro_codename=$(lsb_release -sc)
|
||||
local wo_linux_distro
|
||||
wo_linux_distro=$(lsb_release -is)
|
||||
if [ -d ./dist ]; then
|
||||
rm -rf dist
|
||||
if [ -d "$wo_install_dir/dist" ]; then
|
||||
rm -rf "$wo_install_dir/dist"
|
||||
fi
|
||||
if [ -f ./setup.py ]; then
|
||||
if [ -f "$wo_install_dir/setup.py" ]; then
|
||||
if [ -d /opt/wo/lib/python3."$python_ver"/site-packages/apt ]; then
|
||||
source /opt/wo/bin/activate
|
||||
/opt/wo/bin/pip uninstall -yq setuptools
|
||||
@@ -816,8 +817,8 @@ wo_init() {
|
||||
bash -c "echo -e \"[user]\n\tname = $USER_OR_WORDOPS\n\temail = root@$HOSTNAME.local\" > $HOME/.gitconfig"
|
||||
}
|
||||
fi
|
||||
if [ -f ./setup.py ]; then
|
||||
wo_version_new=$(grep "version='" setup.py | awk -F "'" '{print $2}' 2>&1)
|
||||
if [ -f "$wo_install_dir/setup.py" ]; then
|
||||
wo_version_new=$(grep "version='" "$wo_install_dir/setup.py" | awk -F "'" '{print $2}' 2>&1)
|
||||
else
|
||||
wo_version_new=$(curl -m 5 --retry 3 -sL https://api.github.com/repos/WordOps/WordOps/releases/latest 2>&1 | jq -r '.tag_name')
|
||||
fi
|
||||
@@ -845,6 +846,9 @@ wo_git_secure_path() {
|
||||
# 4 - WO MAIN SETUP
|
||||
###
|
||||
|
||||
# save the directory from which the install was launched
|
||||
readonly wo_install_dir="$(pwd)"
|
||||
|
||||
# create required directories
|
||||
wo_dir_init
|
||||
# install lsb_release, curl, gpg and display header
|
||||
|
||||
Reference in New Issue
Block a user