#!/bin/bash
# Wrapper script to run Poltergeist from the correct directory
# This works around the issue where Poltergeist doesn't handle
# being run from outside its directory properly
# Get the directory of this script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIR="$( cd "$SCRIPT_DIR/.." && pwd )"
# Change to project directory to ensure paths are resolved correctly
cd "$PROJECT_DIR"
# Run Poltergeist with all arguments passed through
exec node ../poltergeist/dist/cli.js "$@"