#!/bin/bash
set -e

script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "$script_dir/functions"

STAPLER=/Users/torbrowser/Xcode.app/Contents//Developer/usr/bin/stapler

cd ~/${tbb_version}

for LANG in $bundle_locales
do
  echo "Stapling $LANG..."
  cd $LANG
  $STAPLER staple Tor\ Browser.app
  zip -qr ../tb-${tbb_version}_$LANG-stapled.zip Tor\ Browser.app
  cd ..
done
