fixed scripts for dynamic path detection
This commit is contained in:
parent
f2b77f38b4
commit
3227497e45
5 changed files with 67 additions and 10 deletions
|
|
@ -12,7 +12,15 @@ echo -e "${CYAN}Building and installing new libraries...${NC}"
|
|||
|
||||
# Store original location
|
||||
ORIGINAL_DIR=$(pwd)
|
||||
cd "/home/boki/stock-bot"
|
||||
|
||||
# Find git root directory
|
||||
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED}Error: Not in a git repository. Please run this script from within the stock-bot git repository.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$GIT_ROOT"
|
||||
|
||||
cleanup() {
|
||||
cd "$ORIGINAL_DIR"
|
||||
|
|
@ -46,7 +54,7 @@ libs=(
|
|||
|
||||
# Build each library in order
|
||||
for lib in "${libs[@]}"; do
|
||||
lib_path="/home/boki/stock-bot/libs/$lib"
|
||||
lib_path="$GIT_ROOT/libs/$lib"
|
||||
|
||||
echo -e "${GREEN}Building $lib...${NC}"
|
||||
cd "$lib_path"
|
||||
|
|
@ -59,4 +67,4 @@ for lib in "${libs[@]}"; do
|
|||
done
|
||||
|
||||
echo -e "${GREEN}All libraries built successfully!${NC}"
|
||||
cd "/home/boki/stock-bot"
|
||||
cd "$GIT_ROOT"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue