#!/bin/bash

# replace timestamp in manifest
p4 edit visimeet.appcache
sed -i "2 s/.*/#$(date +%s)/" visimeet.appcache

# compile jsx into js
jsx js/jsx js

# remake concatenated js and css files
xargs cat < js/all_desktop.inc > /opt/iocom/user/webclient/all_desktop.js
xargs cat < css/all_desktop.inc > /opt/iocom/user/webclient/css/all_desktop.css

xargs cat < js/webrtc_api.inc > /opt/iocom/user/webclient/visiwebrtc.js
uglifyjs /opt/iocom/user/webclient/visiwebrtc.js -o /opt/iocom/user/webclient/visiwebrtc.js