@@ -4,8 +4,9 @@ Provides a way to connect to Gitpod Classic workspaces within the JetBrains Tool
44
55## How to Develop with Gitpod Flex
66
7+ - Start an environment on [ Gitpod Flex] ( https://app.gitpod.io ) with current repository
78- Connect to the environment via ** JetBrains Gateway** (because we want to restart Toolbox) SSH feature (user: gitpod_devcontainer)
8- - Copy flex-sync.sh locally and chmod +x
9+ - Copy flex-sync.sh locally and chmod +x, the script is written for macOS, please adjust it if you're using other OS
910- Exec ` ./flex-sync.sh <env_host> `
1011
1112``` sh
@@ -22,28 +23,37 @@ LOCAL_DIR="$HOME/Library/Caches/JetBrains/Toolbox/plugins"
2223REMOTE_DIR=" /workspace/gitpod/components/ide/jetbrains/toolbox/build/flex"
2324DEVCONTAINER_HOST=" gitpod_devcontainer@$REMOTE_HOST "
2425
25- ssh $DEVCONTAINER_HOST " apt-get update && apt-get install -y rsync inotify-tools "
26+ echo " Preparing... "
2627
27- echo " Watching for changes in $DEVCONTAINER_HOST : $REMOTE_DIR "
28+ ssh $DEVCONTAINER_HOST " apt-get update && apt-get install -y rsync inotify-tools " > /dev/null
2829
29- ssh $DEVCONTAINER_HOST " inotifywait -m -r -e modify,create,delete,move $REMOTE_DIR " | \
30- while read path action file; do
31- echo " [$( date ' +%Y-%m-%d %H:%M:%S' ) ] Change detected: $action $file "
32- # Make sure remote is build
33- sleep 3
30+ function sync_and_restart() {
3431 rsync -avz --delete " $DEVCONTAINER_HOST :$REMOTE_DIR /" " $LOCAL_DIR /"
35-
36- echo " [$( date ' +%Y-%m-%d %H:%M:%S' ) ] Change synced"
3732 pkill -f ' JetBrains Toolbox' || true
3833 echo debugClean > $HOME /Library/Logs/JetBrains/Toolbox/toolbox.log
3934 code $HOME /Library/Logs/JetBrains/Toolbox/toolbox.log
4035 # In case Toolbox refuses to start
36+ echo " Restarting Toolbox in 3 seconds"
4137 sleep 3
4238 open /Applications/JetBrains\ Toolbox.app
39+ }
40+
41+ echo " Initing..."
42+
43+ sync_and_restart
44+
45+ echo " Watching for changes in $DEVCONTAINER_HOST :$REMOTE_DIR "
46+
47+ ssh $DEVCONTAINER_HOST " inotifywait -m -r -e modify,create,delete,move $REMOTE_DIR " | \
48+ while read path action file; do
49+ echo " [$( date ' +%Y-%m-%d %H:%M:%S' ) ] Change detected: $action $file "
50+ # Make sure remote is build
51+ sleep 3
52+ sync_and_restart
4353done
4454```
4555
46- ## How to Develop
56+ ## How to Develop locally
4757
4858### Requires
4959- Java 21
0 commit comments