Add files

This commit is contained in:
Nicolas FRADIN 2023-12-04 09:44:08 +01:00
parent 63d781ebb7
commit 45fbbdf415
5 changed files with 82 additions and 1 deletions

7
.gitignore vendored
View File

@ -1,3 +1,10 @@
# IDE folders
.idea
# Others
dist
cmake-*
# ---> C++
# Prerequisites
*.d

View File

@ -1,2 +1,2 @@
# lutris-prelauncher
# Lutris Pre-Launcher

1
VERSION Normal file
View File

@ -0,0 +1 @@
1.0.0

9
release.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
VERSION="$(cat VERSION)"
mkdir -p ./dist
cp ./src/main.sh ./dist/lutris-prelaunch.sh
TO_REPLACE='$(cat VERSION)'
sed -i "s/$TO_REPLACE/$VERSION/g" ./dist/lutris-prelaunch.sh

64
src/main.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/bash
NAME="Lutris Pre-Launcher"
SCRIPT_NAME="lutris-prelauncher.sh"
VERSION="$(cat VERSION)"
QUIET=0
CHECK_GAME_UPDATE=1
GPU_SETTINGS=1
cReset='\033[0m' # Reset
cRed='\033[0;31m' # Red
#------------------------------------------------------------------------------
# Log the given String to stdout if QUIET == 0
#------------------------------------------------------------------------------
function log() {
[ $QUIET -eq 0 ] && echo "$1"
}
#------------------------------------------------------------------------------
# Log the given String to stderror
#------------------------------------------------------------------------------
function error() {
echo -e "${cRed}$1${cReset}" 1>&2
}
#------------------------------------------------------------------------------
# Display help
#------------------------------------------------------------------------------
function help() {
echo "Usage: $SCRIPT_NAME [OPTIONS]"
echo ""
echo "Available options:"
echo -e " -gu | --game-update \tEnable game update check."
echo -e " -h | --help \t\tDisplay this help message."
echo -e " -nvs | --nvidia-settings \tEnable nvidia settings."
echo -e " -q | --quiet \t\tDisable program output."
}
#------------------------------------------------------------------------------
# Main - Entry Point
#------------------------------------------------------------------------------
log "$NAME v$VERSION"
if [ $CHECK_GAME_UPDATE -eq 1 ]; then
GAME_ID="Test"
if [ -z "$GAME_ID" ]; then
error "Error: 'GAME_ID' variable is undefined!"
exit 1
fi
# TODO: Implement Game Update Check
echo "-> Check game update"
fi
if [ $GPU_SETTINGS -eq 1 ]; then
# TODO: Implement Gpu Settings
echo "-> Gpu Settings"
fi
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
help
fi