makedeb


zelda-classic-bin 2.50.2.29-0


A tribute to Nintendo's The Legend of Zelda (NES), read install instructions in README.pkg

Viewing /zelda-classic.sh.

View raw.

Click here to go back to the Git tree for zelda-classic-bin.

#!/bin/sh
#
# Zelda Classic launcher - (c) carstene1ns 2013
#                          (c) exponential 2022
# Does some magic juggling with the data files

# Changelog:
#  * 11-2016: Added XDG support
#  * 2022: refactor

_name="zelda-classic"
config_dir="${XDG_CONFIG_HOME:-$HOME/.config}/$_name"

cp -nas "/usr/share/games/$_name/" "${XDG_CONFIG_HOME:-$HOME/.config}"
cp -nas "/usr/lib/$_name/"*.so "$config_dir"
cp -nas "/usr/libexec/$_name/"z*-l "$config_dir"
cp -nas "/usr/share/doc/$_name/zquest.txt" "$config_dir"

# change to directory and launch
cd "$config_dir"

case "${0##*/}" in
  "$_name")
    exec ./zelda-l "$@"
    ;;
  "$_name-zlaunch")
    exec ./zlaunch-l "$@"
    ;;
  "$_name-zquest")
    exec ./zquest-l "$@"
    ;;
  *)
    echo "Something is wrong with your Zelda Classic installation."
    ;;
esac

cd - &>/dev/null