#!/bin/bash
cd "$(dirname "$0")"

# Use Unix timestamp for cache busting
TS=$(date +%s)

# Update CSS and JS cache-busting versions
sed -i '' "s/dashboard\\.css?v=[0-9]*/dashboard.css?v=${TS}/" templates.go
sed -i '' "s/dashboard\\.js?v=[0-9]*/dashboard.js?v=${TS}/" templates.go

echo "Cache bust: ${TS}"

~/apps/.launch.sh "$@"
