#!/usr/bin/env bash

# run with 
# curl -s https://git.dbogatov.org/-/snippets/51/raw/master/set-apps-for-extensions.sh | bash

set -e

echo "Setting extensions"

set -x

for extension in "md" "txt" "tex" "aux" "bib" "ris" "log" "sh" "c" "cpp" "h" "hpp" "py" "yaml" "yml" "json" "sql"
do
    duti -s $(osascript -e 'id of app "Visual Studio Code"') .$extension all
done

duti -s $(osascript -e 'id of app "Skim"') ".pdf" all

duti -s $(osascript -e 'id of app "Safari"') ".svg" all

echo "Done."