Skip to content

Commit b7c084b

Browse files
Merge pull request #7 from Chintanpatel24/classic-ui-and-demo-mode
implement classic chat UI, local demo/mock mode, and update.sh …
2 parents 225a5dc + 271afed commit b7c084b

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ bun install
8383
bun link # optional global arrowcode / ac
8484
```
8585

86+
### Update
87+
88+
To update ArrowCode while preserving any local modifications you have made:
89+
90+
```bash
91+
./update.sh
92+
```
93+
8694
### Setup API key
8795

8896
```bash

update.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# ArrowCode local updater script
5+
# Updates the ArrowCode repository to the latest code on the current branch while preserving local changes
6+
7+
RED=$'\033[0;31m'
8+
GRN=$'\033[0;32m'
9+
CYN=$'\033[0;36m'
10+
RST=$'\033[0m'
11+
12+
log() { printf '%s==>%s %s\n' "$CYN" "$RST" "$*"; }
13+
ok() { printf '%s[ok]%s %s\n' "$GRN" "$RST" "$*"; }
14+
err() { printf '%s[err]%s %s\n' "$RED" "$RST" "$*" >&2; }
15+
16+
# Find ArrowCode base directory
17+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18+
cd "$DIR"
19+
20+
log "Updating ArrowCode at $DIR..."
21+
22+
# Keep local changes with git stash if there are any
23+
HAS_CHANGES=0
24+
if ! git diff --quiet || ! git diff --cached --quiet; then
25+
HAS_CHANGES=1
26+
log "Saving local changes with git stash..."
27+
git stash -u
28+
fi
29+
30+
# Fetch and rebase / merge latest from branch
31+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
32+
log "Fetching latest commits from remote on branch: $BRANCH"
33+
git fetch origin "$BRANCH"
34+
35+
log "Pulling latest changes..."
36+
git pull --rebase origin "$BRANCH"
37+
38+
# Restore local changes if stashed
39+
if [ "$HAS_CHANGES" -eq 1 ]; then
40+
log "Restoring local changes..."
41+
git stash pop
42+
fi
43+
44+
# Re-install dependencies with bun
45+
log "Running bun install to ensure package sync..."
46+
bun install
47+
48+
ok "ArrowCode successfully updated!"

0 commit comments

Comments
 (0)