From 53cc7fb75064b1349cffc039db922b9854b2d9a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20R=C3=B8nnestad=20Birkeland?= <6450056+o-l-a-v@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:46:53 +0100 Subject: [PATCH 1/3] Fix hash extraction and installer logic --- bucket/beaver-notes.json | 41 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/bucket/beaver-notes.json b/bucket/beaver-notes.json index b093c787fdb1c1..11e30c573c6c0d 100644 --- a/bucket/beaver-notes.json +++ b/bucket/beaver-notes.json @@ -1,23 +1,18 @@ { "$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json", - "version": "3.7.0", + "version": "3.8.0", "description": "A privacy-focused note-taking application", "homepage": "https://beavernotes.com/", "license": "MIT", - "architecture": { - "64bit": { - "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/download/3.7.0/Beaver-notes.3.7.0.portable.exe#/dl.7z", - "hash": "dfc1b8576512f9f13527a62073f6c59cada548b105c3061ff2684c6337b40c8f" - }, - "arm64": { - "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/download/3.7.0/Beaver-notes.3.7.0.portable.arm64.exe#/dl.7z", - "hash": "832e161da398f7bd61e1fd7baed683ff19ad169aee679cff07dfae2af3fb28e9" - } - }, + "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/download/3.8.0/Beaver-notes-3.8.0-portable.exe#/dl.7z", + "hash": "64b52605d04cfd3a8888fd4b1f12175e88fc9046450fa7fa171d366906ee412b", "pre_install": [ - "Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app*.7z\" -DestinationPath \"$dir\"", - "$ScriptBlock = [scriptblock]{Remove-Item -Path \"$dir\\`$*\", \"$dir\\Uninstall*\" -Force -Recurse}", - "Try {$ScriptBlock.Invoke()} Catch {Start-Sleep -Milliseconds 50; $ScriptBlock.Invoke()}" + "if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') {", + " Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app-arm64.7z\" -DestinationPath \"$dir\"", + "}", + "else {", + " Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app-64.7z\" -DestinationPath \"$dir\"", + "}" ], "shortcuts": [ [ @@ -42,21 +37,9 @@ "github": "https://github.com/Beaver-Notes/Beaver-Notes" }, "autoupdate": { - "architecture": { - "64bit": { - "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/download/$version/Beaver-notes.$version.portable.exe#/dl.7z", - "hash": { - "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/tag/$version", - "regex": "$version.portable.exe.+?\\n.+?($sha256)" - } - }, - "arm64": { - "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/download/$version/Beaver-notes.$version.portable.arm64.exe#/dl.7z", - "hash": { - "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/tag/$version", - "regex": "$version.portable.arm64.exe.+?\\n.+?($sha256)" - } - } + "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/download/$version/Beaver-notes-$version-portable.exe#/dl.7z", + "hash": { + "url": "$baseurl/checksums.sha256" } } } From d003e2e9254f80f8b1e0870b41fc3c6984ed1a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20R=C3=B8nnestad=20Birkeland?= <6450056+o-l-a-v@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:10:46 +0100 Subject: [PATCH 2/3] Don't persist data as it's not used + readd remove leftovers from parent archive --- bucket/beaver-notes.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bucket/beaver-notes.json b/bucket/beaver-notes.json index 11e30c573c6c0d..78094c25b44d09 100644 --- a/bucket/beaver-notes.json +++ b/bucket/beaver-notes.json @@ -12,7 +12,9 @@ "}", "else {", " Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app-64.7z\" -DestinationPath \"$dir\"", - "}" + "}", + "$ScriptBlock = [scriptblock]{Remove-Item -Path \"$dir\\`$PLUGINSDIR\" -Force -Recurse}", + "Try {$ScriptBlock.Invoke()} Catch {Start-Sleep -Milliseconds 50; $ScriptBlock.Invoke()}" ], "shortcuts": [ [ @@ -20,7 +22,6 @@ "Beaver Notes" ] ], - "persist": "data", "post_uninstall": [ "if ($purge) {", " $Directories = [string[]](", From 34b3747694d3410ec1c94eb67ed165bb48ebc933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20R=C3=B8nnestad=20Birkeland?= <6450056+o-l-a-v@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:20:23 +0100 Subject: [PATCH 3/3] Use Scoop to decide system architecture, like with Obisidian --- bucket/beaver-notes.json | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bucket/beaver-notes.json b/bucket/beaver-notes.json index 78094c25b44d09..602199da714cae 100644 --- a/bucket/beaver-notes.json +++ b/bucket/beaver-notes.json @@ -4,15 +4,17 @@ "description": "A privacy-focused note-taking application", "homepage": "https://beavernotes.com/", "license": "MIT", + "architecture": { + "64bit": { + "pre_install": "Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app-64.7z\" -DestinationPath \"$dir\"" + }, + "arm64": { + "pre_install": "Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app-arm64.7z\" -DestinationPath \"$dir\"" + } + }, "url": "https://github.com/Beaver-Notes/Beaver-Notes/releases/download/3.8.0/Beaver-notes-3.8.0-portable.exe#/dl.7z", "hash": "64b52605d04cfd3a8888fd4b1f12175e88fc9046450fa7fa171d366906ee412b", - "pre_install": [ - "if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') {", - " Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app-arm64.7z\" -DestinationPath \"$dir\"", - "}", - "else {", - " Expand-7zipArchive -Path \"$dir\\`$PLUGINSDIR\\app-64.7z\" -DestinationPath \"$dir\"", - "}", + "post_install": [ "$ScriptBlock = [scriptblock]{Remove-Item -Path \"$dir\\`$PLUGINSDIR\" -Force -Recurse}", "Try {$ScriptBlock.Invoke()} Catch {Start-Sleep -Milliseconds 50; $ScriptBlock.Invoke()}" ],