#!/bin/sh

cd $(dirname $0)

first=y

open() {
    if [ "$first" = "y" ]
    then
        tmux new-window "$1"
        first=n
    else
        tmux split-window "$1" \; select-layout tiled
    fi
}

open "cd packages/core; yarn run compile:watch"
open "cd packages/core; yarn run rollup:watch"
open "cd packages/core; yarn run test:watch"
open "cd packages/schema; yarn run compile:watch"
open "cd packages/schema; yarn run rollup:watch"
open "cd packages/schema; yarn run test:watch"
open "cd packages/schema-cli; yarn run compile:watch"
open "cd packages/schema-cli; yarn run rollup:watch"

tmux select-layout even-vertical
