#!/bin/bash
# Package Apex NAS100 deliverable from the git repo into /mnt/agents/output/
set -e
cd /mnt/agents/output/project
PKG=/mnt/agents/output/ApexNAS100
rm -rf "$PKG"
mkdir -p "$PKG/MQL5/Include" "$PKG/MQL5/Experts" "$PKG/MQL5/Indicators" "$PKG/MQL5/Presets"
cp -r Include/Apex "$PKG/MQL5/Include/Apex"
cp Experts/Apex_NAS100_EA.mq5 "$PKG/MQL5/Experts/"
cp Indicators/Apex_NAS100_Indicator.mq5 "$PKG/MQL5/Indicators/"
cp Presets/*.set "$PKG/MQL5/Presets/"
cp README.md SPEC.md "$PKG/"
cd /mnt/agents/output
rm -f ApexNAS100.zip
zip -rq ApexNAS100.zip ApexNAS100
echo "=== package contents ==="
find "$PKG" -type f | sort
echo "=== sizes ==="
du -sh "$PKG" ApexNAS100.zip
wc -l "$PKG"/MQL5/Include/Apex/*.mqh "$PKG"/MQL5/Experts/*.mq5 "$PKG"/MQL5/Indicators/*.mq5 | tail -1
