Skip to content

Commit

Permalink
Fix the package script so it generates a zip that can be installed fr…
Browse files Browse the repository at this point in the history
…om decky's "install from zip"
  • Loading branch information
wheaney committed Sep 4, 2023
1 parent 5a830ea commit 4229905
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ pnpm run build
tmpdir=$(mktemp -d)

# Create plugin directory structure
mkdir -p "$tmpdir/$pluginname"
cp -r dist "$tmpdir/$pluginname"
cp package.json plugin.json main.py README.md LICENSE* "$tmpdir/$pluginname/"
mkdir -p "$tmpdir/$pluginname/$pluginname"
cp -r dist "$tmpdir/$pluginname/$pluginname"
cp package.json plugin.json main.py README.md LICENSE* "$tmpdir/$pluginname/$pluginname"

# Copy binaries if provided
if [ ${#binaryPaths[@]} -gt 0 ]; then
mkdir -p "$tmpdir/$pluginname/bin"
mkdir -p "$tmpdir/$pluginname/$pluginname/bin"
for binaryPath in "${binaryPaths[@]}"; do
cp "$binaryPath" "$tmpdir/$pluginname/bin/"
cp "$binaryPath" "$tmpdir/$pluginname/$pluginname/bin/"
done
fi

Expand Down Expand Up @@ -58,7 +58,7 @@ read -s -p "Enter the password for deck@${deckip}: " password
output=$(sshpass -p "$password" scp "$zip_name" deck@"$deckip":/home/deck/Downloads)
echo "$output"

output=$(sshpass -p "$password" ssh deck@${deckip} "set -e; echo '${password}' | sudo -S chmod -R ug+rw /home/deck/homebrew/; mkdir -p /home/deck/homebrew/pluginloader; mkdir -p /home/deck/homebrew/plugins/$pluginname; rm -rf /home/deck/homebrew/plugins/$pluginname/*; unzip /home/deck/Downloads/$zip_name -d /home/deck/homebrew/plugins/$pluginname; echo '${password}' | sudo -S systemctl restart plugin_loader")
output=$(sshpass -p "$password" ssh deck@${deckip} "set -e; echo '${password}' | sudo -S chmod -R ug+rw /home/deck/homebrew/; mkdir -p /home/deck/homebrew/pluginloader; echo '${password}' | sudo -S rm -rf /home/deck/homebrew/plugins/$pluginname; echo '${password}' | sudo -S unzip /home/deck/Downloads/$zip_name -d /home/deck/homebrew/plugins; echo '${password}' | sudo -S systemctl restart plugin_loader")
echo "$output"

if [ $? -ne 0 ]; then
Expand Down

0 comments on commit 4229905

Please sign in to comment.