improve test script for emulation station
This commit is contained in:
parent
75e663ab74
commit
c6c29599cc
1 changed files with 17 additions and 1 deletions
18
launch_es.sh
18
launch_es.sh
|
@ -1,5 +1,21 @@
|
|||
export NIXPKGS_ALLOW_UNFREE=1
|
||||
|
||||
RESULT=$(nix-build -E 'import ((import ./npins).nixpkgs + "/nixos")' -A config.retronix.emulationstation.cli -I nixos-config=configuration.nix --no-out-link $@)
|
||||
# get script dir
|
||||
#
|
||||
SOURCE=${BASH_SOURCE[0]}
|
||||
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
|
||||
SOURCE=$(readlink "$SOURCE")
|
||||
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
|
||||
|
||||
pushd "$DIR" || exit 1
|
||||
|
||||
RESULT=$(nix-build -E 'import ((import ./npins).nixpkgs + "/nixos")' -A config.retronix.emulationstation.cli -I nixos-config=configuration.nix --no-out-link $@) || popd || exit 1
|
||||
|
||||
popd || exit 1
|
||||
|
||||
echo -e "Running: $RESULT\n"
|
||||
|
||||
$RESULT
|
||||
|
|
Loading…
Reference in a new issue