Skip to content

Commit

Permalink
Use the .gitignore from the Plugin Template
Browse files Browse the repository at this point in the history
  • Loading branch information
Fisch03 committed Apr 5, 2023
1 parent 8ca4213 commit 563b855
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.vscode

lib-cov
*.seed
*.log
Expand All @@ -15,9 +13,6 @@ logs
results
tmp

# Build
public/css/main.css

# Coverage reports
coverage

Expand All @@ -27,6 +22,7 @@ coverage
# Dependency directory
node_modules
bower_components
.pnpm-store

# Editors
.idea
Expand All @@ -39,5 +35,16 @@ Thumbs.db
# Ignore built ts files
dist/

# ignore yarn.lock
yarn.lock
__pycache__/

/.yalc
yalc.lock

.vscode/settings.json

# Ignore output folder

backend/out

# Make sure to ignore any instance of the loader's decky_plugin.py
decky_plugin.py
12 changes: 12 additions & 0 deletions .vscode/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
# printf "${SCRIPT_DIR}\n"
# printf "$(dirname $0)\n"
if ! [[ -e "${SCRIPT_DIR}/settings.json" ]]; then
printf '.vscode/settings.json does not exist. Creating it with default settings. Exiting afterwards. Run your task again.\n\n'
cp "${SCRIPT_DIR}/defsettings.json" "${SCRIPT_DIR}/settings.json"
exit 1
else
printf '.vscode/settings.json does exist. Congrats.\n'
printf 'Make sure to change settings.json to match your deck.\n'
fi
10 changes: 10 additions & 0 deletions .vscode/defsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"deckip" : "0.0.0.0",
"deckport" : "22",
"deckpass" : "ssap",
"deckkey" : "-i ${env:HOME}/.ssh/id_rsa",
"deckdir" : "/home/deck",
"python.analysis.extraPaths": [
"./py_modules"
]
}
116 changes: 116 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"version": "2.0.0",
"tasks": [
// OTHER
{
"label": "checkforsettings",
"type": "shell",
"group": "none",
"detail": "Check that settings.json has been created",
"command": "bash -c ${workspaceFolder}/.vscode/config.sh",
"problemMatcher": []
},
// BUILD
{
"label": "pnpmsetup",
"type": "shell",
"group": "build",
"detail": "Setup pnpm",
"command": "pnpm i",
"problemMatcher": []
},
{
"label": "updatefrontendlib",
"type": "shell",
"group": "build",
"detail": "Update deck-frontend-lib",
"command": "pnpm update decky-frontend-lib --latest",
"problemMatcher": []
},
{
"label": "build",
"type": "npm",
"group": "build",
"detail": "rollup -c",
"script": "build",
"path": "",
"problemMatcher": []
},
{
"label": "buildall",
"group": "build",
"detail": "Build decky-plugin-template",
"dependsOrder": "sequence",
"dependsOn": [
"pnpmsetup",
"build"
],
"problemMatcher": []
},
// DEPLOY
{
"label": "createfolders",
"detail": "Create plugins folder in expected directory",
"type": "shell",
"group": "none",
"dependsOn": [
"checkforsettings"
],
"command": "ssh deck@${config:deckip} -p ${config:deckport} ${config:deckkey} 'mkdir -p ${config:deckdir}/homebrew/pluginloader && mkdir -p ${config:deckdir}/homebrew/plugins'",
"problemMatcher": []
},
{
"label": "deploy",
"detail": "Deploy dev plugin to deck",
"type": "shell",
"group": "none",
"dependsOn": [
"createfolders",
"chmodfolders"
],
"command": "rsync -azp --delete --chmod=D0755,F0755 --rsh='ssh -p ${config:deckport} ${config:deckkey}' --exclude='.git/' --exclude='.github/' --exclude='.vscode/' --exclude='node_modules/' --exclude='src/' --exclude='*.log' --exclude='.gitignore' . deck@${config:deckip}:${config:deckdir}/homebrew/plugins/${workspaceFolderBasename}",
"problemMatcher": []
},
{
"label": "restartloader",
"detail": "Restart the plugin loader (to load updated python code)",
"type": "shell",
"group": "none",
"dependsOn": [],
"command": "ssh deck@${config:deckip} -p ${config:deckport} ${config:deckkey} 'echo '${config:deckpass}' | sudo -S systemctl restart plugin_loader'",
"problemMatcher": []
},
{
"label": "chmodfolders",
"detail": "chmods folders to prevent perms issues",
"type": "shell",
"group": "none",
"command": "ssh deck@${config:deckip} -p ${config:deckport} ${config:deckkey} 'echo '${config:deckpass}' | sudo -S chmod -R ug+rw ${config:deckdir}/homebrew/'",
"problemMatcher": []
},
{
"label": "deployall",
"dependsOrder": "sequence",
"group": "none",
"dependsOn": [
"deploy",
"chmodfolders"
],
"problemMatcher": []
},
// ALL-IN-ONE
{
"label": "allinone",
"detail": "Build and deploy",
"dependsOrder": "sequence",
"group": "test",
"dependsOn": [
"buildall",
"deployall"
// Uncomment this line if you'd like your python code reloaded after deployment (this will restart Steam)
// ,"restartloader"
],
"problemMatcher": []
}
]
}

0 comments on commit 563b855

Please sign in to comment.