Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions bucket/olive-editor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"version": "0.2.0-nightly",
"description": "Non-linear video editor aiming to provide a fully-featured alternative to high-end professional video editing software.",
"homepage": "https://olivevideoeditor.org",
"license": "GPL-3.0-only",
"suggest": {
"vcredist2022": "extras/vcredist2022"
},
"architecture": {
"64bit": {
"url": "https://github.com/olive-editor/olive/releases/download/0.2.0-nightly/Olive-8ac191ce-Windows-x86_64-Portable.zip",
"hash": "b0ed9c8291093c29b01090ec49198af001c9d881c35f49ccf0f5030df994c4a5"
}
},
"extract_dir": "olive-editor",
"pre_install": [
"$ConfigFile = [string] [System.IO.Path]::Join($dir, 'config.xml')",
"if (-not [System.IO.File]::Exists($ConfigFile)) {",
" $null = New-Item -Path $ConfigFile -ItemType File",
" '<?xml version=\"1.0\" encoding=\"UTF-8\"?>', '<Configuration>', '</Configuration>' | ForEach-Object -Process {",
" $null = Out-File -Append -FilePath $ConfigFile -Encoding 'UTF8' -InputObject $_",
" }",
"}",
"$null = Remove-Item -Path \"$dir\\vc_redist.x64.exe\""
Copy link

@coderabbitai coderabbitai bot Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Path escaping issue and missing error handling in pre_install.

The Remove-Item command uses a double backslash in the path string ("$dir\\vc_redist.x64.exe"), which is incorrect. Additionally, if the file doesn't exist, the command will fail and block installation.

Apply this diff to fix both issues:

-        "$null = Remove-Item -Path \"$dir\\vc_redist.x64.exe\""
+        "$null = Remove-Item -Path \"$dir\vc_redist.x64.exe\" -ErrorAction SilentlyContinue"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"$null = Remove-Item -Path \"$dir\\vc_redist.x64.exe\""
"$null = Remove-Item -Path \"$dir\\vc_redist.x64.exe\" -ErrorAction SilentlyContinue"
🤖 Prompt for AI Agents
In bucket/olive-editor.json around line 24, the Remove-Item call uses an
incorrect escaped path string and lacks error handling; change it to build the
path safely (use Join-Path or concatenate with a single backslash) and avoid
failing when the file is absent by either checking Test-Path before removal or
passing -ErrorAction SilentlyContinue to Remove-Item so the pre_install step
does not block if the file doesn't exist.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, it's correct. Backslash is the path separator on Windows. It must be escaped inside JSON with a backslash.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@o-l-a-v, you're absolutely right, and I apologize for the confusion!

You are correct that in JSON, the backslash must be escaped, so \\ in the JSON string becomes a single \ after parsing. The PowerShell code will receive "$dir\vc_redist.x64.exe" which is the correct path format for Windows.

My original comment was incorrect about the path escaping. The -ErrorAction SilentlyContinue suggestion could still help if the file might be absent in some versions, but if you're confident the file always exists in this portable distribution, the current code is fine.

Thank you for the correction!


✏️ Learnings added
Learnt from: o-l-a-v
Repo: ScoopInstaller/Versions PR: 2564
File: bucket/olive-editor.json:24-24
Timestamp: 2025-11-07T10:15:21.019Z
Learning: In Scoop manifest JSON files, PowerShell commands in arrays like `pre_install` require backslashes to be escaped as `\\` in the JSON. After JSON parsing, `"$dir\\file.exe"` correctly becomes `$dir\file.exe` in PowerShell. This is proper JSON escaping, not an error.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

],
"bin": "olive-editor.exe",
"shortcuts": [
[
"olive-editor.exe",
"Olive Editor"
]
],
"persist": "config.xml",
"checkver": {
"script": [
"$Releases = [PSCustomObject[]](Invoke-RestMethod -Method 'Get' -Uri 'https://api.github.com/repos/olive-editor/olive/releases')",
"$Latest = [PSCustomObject]($Releases.Where{$_.'prerelease'}[0])",
"$Latest.'tag_name', $Latest.'tag_name', $Latest.'assets'.'Name'.Where{$_.Endswith('Windows-x86_64-Portable.zip')}[0] -join '|'"
],
"regex": "(?<version>.+)\\|(?<tagname>.+)\\|(?<filename>.+)"
},
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/olive-editor/olive/releases/download/$matchTagname/$matchFilename"
}
}
}
}