#!/bin/sh
# sheerpower-samples -- a copy of the sample applications in the user's home (2026-11-02): /opt/sheerpower/samples
# belongs to root, so a sample that writes its own files runs from a copy -- ~/sheerpower_samples, or the folder named.
# A folder already there is never written over.
target=${1:-$HOME/sheerpower_samples}
if [ -e "$target" ]; then
  echo "sheerpower-samples: $target is already there -- nothing copied (name another folder to copy them again)"
  exit 1
fi
cp -r /opt/sheerpower/samples "$target" || exit 1
chmod -R u+w "$target"
echo "The Sheerpower sample applications are in $target (readme.md says what each one is)."
echo "Run one with:  cd $target  then  sp4gl <name>.spsrc"
