-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsetup-workspace.sh
More file actions
33 lines (29 loc) · 975 Bytes
/
setup-workspace.sh
File metadata and controls
33 lines (29 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
set -e
WORKSPACE="/home/coder/workspace"
PROJECT="$WORKSPACE/AIPass"
FORK="https://github.com/Input-X/AIPass.git"
UPSTREAM="https://github.com/AIOSAI/AIPass.git"
export PATH="/opt/venv/bin:$PATH"
# Ensure workspace directory exists and is writable
mkdir -p "$WORKSPACE"
if [ ! -w "$WORKSPACE" ]; then
echo "==> Fixing workspace permissions..."
sudo chown -R coder:coder "$WORKSPACE"
fi
# Clone repo if not already present
if [ ! -d "$PROJECT/.git" ]; then
echo "==> First boot: cloning into AIPass/..."
git clone "$FORK" "$PROJECT"
cd "$PROJECT"
git remote add upstream "$UPSTREAM"
echo "==> Installing AIPass in editable mode..."
pip install -e .
echo "==> Workspace ready!"
echo "==> origin = $FORK (your fork - push here)"
echo "==> upstream = $UPSTREAM (pull updates from here)"
else
echo "==> Workspace exists, ensuring deps are installed..."
cd "$PROJECT"
pip install -e . 2>/dev/null || true
fi