mirror of
https://github.com/dragoonDorise/EmuDeck.git
synced 2024-06-02 19:47:51 -04:00
API
This commit is contained in:
parent
cd70619a1b
commit
116e21e5f9
24
api.sh
24
api.sh
|
@ -1,9 +1,7 @@
|
|||
#!/bin/bash
|
||||
. "$HOME/.config/EmuDeck/backend/functions/all.sh"
|
||||
|
||||
API_pull(){
|
||||
local branch = $1
|
||||
cd ~/.config/EmuDeck/backend && touch ~/emudeck/logs/git.log && script ~/emudeck/logs/git.log -c 'git reset --hard && git clean -fd && git checkout $branch && git pull' && . ~/.config/EmuDeck/backend/functions/all.sh && appImageInit
|
||||
cd ~/.config/EmuDeck/backend && touch ~/emudeck/logs/git.log && script ~/emudeck/logs/git.log -c 'git reset --hard && git clean -fd && git checkout $branch && git pull' && appImageInit
|
||||
}
|
||||
|
||||
API_autoSave(){
|
||||
|
@ -51,4 +49,22 @@ API_setCloud(){
|
|||
else
|
||||
setSetting cloud_sync_status "false" > /dev/null
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
API_setToken(){
|
||||
local token=$1
|
||||
local user=$2
|
||||
echo $token > "$HOME/.config/EmuDeck/.rat" && echo $user > "$HOME/.config/EmuDeck/.rau" && RetroArch_retroAchievementsSetLogin && DuckStation_retroAchievementsSetLogin && PCSX2QT_retroAchievementsSetLogin && echo true
|
||||
}
|
||||
|
||||
API_getToken(){
|
||||
local escapedUserName=$1
|
||||
local escapedPass=$2
|
||||
curl --location --data-urlencode u='$escapedUserName' --data-urlencode p='$escapedPass' --request POST 'https://retroachievements.org/dorequest.php?r=login'
|
||||
}
|
||||
|
||||
|
||||
let bashCommand = `curl --location --data-urlencode u='${escapedUserName}' --data-urlencode p='${escapedPass}' --request POST 'https://retroachievements.org/dorequest.php?r=login'`;
|
||||
if (os.platform().includes('win32')) {
|
||||
bashCommand = `curl "https://retroachievements.org/dorequest.php?r=login&u=${command.user}&p=${command.pass}"`;
|
||||
}
|
13
darwin/api.sh
Normal file
13
darwin/api.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
#
|
||||
##
|
||||
### Darwin overrides
|
||||
##
|
||||
#
|
||||
|
||||
|
||||
API_pull(){
|
||||
local branch = $1
|
||||
cd ~/.config/EmuDeck/backend && git reset --hard && git clean -fd && git checkout ${branchGIT} && git pull && . ~/.config/EmuDeck/backend/functions/all.sh && appImageInit
|
||||
}
|
|
@ -24,6 +24,7 @@ if [ "$system" != "darwin" ]; then
|
|||
fi
|
||||
chmod +x "${EMUDECKGIT}/tools/binaries/xmlstarlet"
|
||||
|
||||
source "$EMUDECKGIT"/api.sh
|
||||
source "$EMUDECKGIT"/functions/checkBIOS.sh
|
||||
source "$EMUDECKGIT"/functions/checkInstalledEmus.sh
|
||||
#source "$EMUDECKGIT"/functions/cloudServicesManager.sh
|
||||
|
@ -105,5 +106,5 @@ if [ "$system" = "darwin" ]; then
|
|||
source "$EMUDECKGIT/darwin/functions/all-darwin.sh"
|
||||
source "$EMUDECKGIT/darwin/functions/helperFunctions.sh"
|
||||
source "$EMUDECKGIT/darwin/functions/overrides.sh"
|
||||
|
||||
source "$EMUDECKGIT/darwin/api.sh"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue