#!/bin/bash

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(realpath "${SCRIPT_DIR}/..")"
CONFIG_DIR="${PROJECT_ROOT}/configs"
DEVICE_CONFIG="${CONFIG_DIR}/${DEVICE_NAME}.conf"

if [ ! -f "$DEVICE_CONFIG" ]; then
    echo "Device Config Not Found: $DEVICE_CONFIG"
    exit 1
fi
#source "$DEVICE_CONFIG"
SYNC="$SCRIPT_DIR/${DEVICE_SYNC_SCRIPT}"
clear
cd "$ROM_PATH" || exit 1
if [ -f "$SYNC" ]; then
    bash "$SYNC"
else
    echo "No Device Sync Script Found For: $DEVICE_DISPLAY_CODENAME"
fi
