Skip to content

Commit

Permalink
fix: make powershell exprs more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Feb 20, 2024
1 parent 5c30d20 commit 5fc4500
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/data/artifacts/inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ fn infer_run_hint_for_script(file: &File) -> String {
file.download_url
)
} else if file.name.ends_with(EXT_SCRIPT_POWERSHELL) {
format!("irm {} | iex", file.download_url)
format!(r#"powershell -c "irm {} | iex""#, file.download_url)
} else {
unimplemented!(
"Looks like someone added a new kind of script but didn't add a run hint for it?"
Expand Down
10 changes: 5 additions & 5 deletions tests/snapshots/gal_akaikatana-public.snap
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ expression: "&snapshots"
<h3>powershell</h3>
<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">iex</span></pre>
<span style="color:#82aaff;">powershell</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">c </span><span style="color:#89ddff;">&quot;</span><span style="color:#c3e88d;">irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex</span><span style="color:#89ddff;">&quot;</span></pre>

<button class="button copy-clipboard-button primary" data-copy="irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex">
<button class="button copy-clipboard-button primary" data-copy="powershell -c "irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex"">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>

Expand Down Expand Up @@ -215,7 +215,7 @@ expression: "&snapshots"
</body>
</html>
================ public/artifacts.json ================
{"format_version":"CENSORED","tag":"v0.2.0","formatted_date":"Aug 8 2023 at 16:03 UTC","platforms_with_downloads":[{"target":["aarch64-apple-darwin"],"display_name":"macOS Apple Silicon","installers":[5,0]},{"target":["x86_64-apple-darwin"],"display_name":"macOS Intel","installers":[5,1]},{"target":["x86_64-pc-windows-msvc"],"display_name":"Windows x64","installers":[4,2]},{"target":["x86_64-unknown-linux-gnu"],"display_name":"Linux x64","installers":[5,3]}],"downloadable_files":[[0,{"name":"akaikatana-repack-aarch64-apple-darwin.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz","view_path":null,"checksum_file":null},["macOS Apple Silicon"]],[3,{"name":"akaikatana-repack-x86_64-apple-darwin.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz","view_path":null,"checksum_file":null},["macOS Intel"]],[4,{"name":"akaikatana-repack-x86_64-pc-windows-msvc.zip","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip","view_path":null,"checksum_file":null},["Windows x64"]],[5,{"name":"akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz","view_path":null,"checksum_file":null},["Linux x64"]]],"release":{"artifacts":{"files":[{"name":"akaikatana-repack-aarch64-apple-darwin.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz","view_path":null,"checksum_file":null},{"name":"akaikatana-repack-installer.ps1","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1","view_path":"akaikatana-repack-installer.ps1.txt","checksum_file":null},{"name":"akaikatana-repack-installer.sh","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.sh","view_path":"akaikatana-repack-installer.sh.txt","checksum_file":null},{"name":"akaikatana-repack-x86_64-apple-darwin.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz","view_path":null,"checksum_file":null},{"name":"akaikatana-repack-x86_64-pc-windows-msvc.zip","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip","view_path":null,"checksum_file":null},{"name":"akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz","view_path":null,"checksum_file":null},{"name":"dist-manifest.json","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/dist-manifest.json","view_path":null,"checksum_file":null}],"installers":[{"label":"tarball","description":"","app_name":null,"method":{"type":"Download","file":0}},{"label":"tarball","description":"","app_name":null,"method":{"type":"Download","file":3}},{"label":"zip","description":"","app_name":null,"method":{"type":"Download","file":4}},{"label":"tarball","description":"","app_name":null,"method":{"type":"Download","file":5}},{"label":"powershell","description":"","app_name":null,"method":{"type":"Run","file":1,"run_hint":"irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex"}},{"label":"shell","description":"","app_name":null,"method":{"type":"Run","file":2,"run_hint":"curl --proto '=https' --tlsv1.2 -LsSf https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.sh | sh"}}],"targets":{"aarch64-apple-darwin":[5,0],"aarch64-pc-windows-msvc":[4],"aarch64-unknown-linux-gnu":[5],"aarch64-unknown-linux-musl":[5],"i686-apple-darwin":[5],"i686-pc-windows-msvc":[4],"i686-unknown-linux-gnu":[5],"i686-unknown-linux-musl":[5],"x86_64-apple-darwin":[5,1],"x86_64-pc-windows-msvc":[4,2],"x86_64-unknown-linux-gnu":[5,3],"x86_64-unknown-linux-musl":[5]}}},"os_script":"/akaikatana-repack/artifacts.js","has_checksum_files":false}
{"format_version":"CENSORED","tag":"v0.2.0","formatted_date":"Aug 8 2023 at 16:03 UTC","platforms_with_downloads":[{"target":["aarch64-apple-darwin"],"display_name":"macOS Apple Silicon","installers":[5,0]},{"target":["x86_64-apple-darwin"],"display_name":"macOS Intel","installers":[5,1]},{"target":["x86_64-pc-windows-msvc"],"display_name":"Windows x64","installers":[4,2]},{"target":["x86_64-unknown-linux-gnu"],"display_name":"Linux x64","installers":[5,3]}],"downloadable_files":[[0,{"name":"akaikatana-repack-aarch64-apple-darwin.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz","view_path":null,"checksum_file":null},["macOS Apple Silicon"]],[3,{"name":"akaikatana-repack-x86_64-apple-darwin.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz","view_path":null,"checksum_file":null},["macOS Intel"]],[4,{"name":"akaikatana-repack-x86_64-pc-windows-msvc.zip","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip","view_path":null,"checksum_file":null},["Windows x64"]],[5,{"name":"akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz","view_path":null,"checksum_file":null},["Linux x64"]]],"release":{"artifacts":{"files":[{"name":"akaikatana-repack-aarch64-apple-darwin.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-aarch64-apple-darwin.tar.xz","view_path":null,"checksum_file":null},{"name":"akaikatana-repack-installer.ps1","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1","view_path":"akaikatana-repack-installer.ps1.txt","checksum_file":null},{"name":"akaikatana-repack-installer.sh","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.sh","view_path":"akaikatana-repack-installer.sh.txt","checksum_file":null},{"name":"akaikatana-repack-x86_64-apple-darwin.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-apple-darwin.tar.xz","view_path":null,"checksum_file":null},{"name":"akaikatana-repack-x86_64-pc-windows-msvc.zip","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-pc-windows-msvc.zip","view_path":null,"checksum_file":null},{"name":"akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-x86_64-unknown-linux-gnu.tar.xz","view_path":null,"checksum_file":null},{"name":"dist-manifest.json","download_url":"https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/dist-manifest.json","view_path":null,"checksum_file":null}],"installers":[{"label":"tarball","description":"","app_name":null,"method":{"type":"Download","file":0}},{"label":"tarball","description":"","app_name":null,"method":{"type":"Download","file":3}},{"label":"zip","description":"","app_name":null,"method":{"type":"Download","file":4}},{"label":"tarball","description":"","app_name":null,"method":{"type":"Download","file":5}},{"label":"powershell","description":"","app_name":null,"method":{"type":"Run","file":1,"run_hint":"powershell -c \"irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex\""}},{"label":"shell","description":"","app_name":null,"method":{"type":"Run","file":2,"run_hint":"curl --proto '=https' --tlsv1.2 -LsSf https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.sh | sh"}}],"targets":{"aarch64-apple-darwin":[5,0],"aarch64-pc-windows-msvc":[4],"aarch64-unknown-linux-gnu":[5],"aarch64-unknown-linux-musl":[5],"i686-apple-darwin":[5],"i686-pc-windows-msvc":[4],"i686-unknown-linux-gnu":[5],"i686-unknown-linux-musl":[5],"x86_64-apple-darwin":[5,1],"x86_64-pc-windows-msvc":[4,2],"x86_64-unknown-linux-gnu":[5,3],"x86_64-unknown-linux-musl":[5]}}},"os_script":"/akaikatana-repack/artifacts.js","has_checksum_files":false}
================ public/changelog/index.html ================
<!DOCTYPE html>
<html lang="en" id="oranda" class="axo">
Expand Down Expand Up @@ -713,9 +713,9 @@ expression: "&snapshots"

<div class="install-code-wrapper">
<pre style="background-color:#263238;">
<span style="color:#82aaff;">irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 </span><span style="color:#89ddff;">| </span><span style="color:#82aaff;">iex</span></pre>
<span style="color:#82aaff;">powershell</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">c </span><span style="color:#89ddff;">&quot;</span><span style="color:#c3e88d;">irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex</span><span style="color:#89ddff;">&quot;</span></pre>

<button class="button copy-clipboard-button primary" data-copy="irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex">
<button class="button copy-clipboard-button primary" data-copy="powershell -c "irm https://github.com/oranda-gallery/akaikatana-repack/releases/download/v0.2.0/akaikatana-repack-installer.ps1 | iex"">
<svg stroke='currentColor' fill='currentColor' stroke-width='0' viewBox='0 0 20 20' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg'><path d='M8 2a1 1 0 000 2h2a1 1 0 100-2H8z'></path><path d='M3 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v6h-4.586l1.293-1.293a1 1 0 00-1.414-1.414l-3 3a1 1 0 000 1.414l3 3a1 1 0 001.414-1.414L10.414 13H15v3a2 2 0 01-2 2H5a2 2 0 01-2-2V5zM15 11h2a1 1 0 110 2h-2v-2z'></path></svg>
</button>

Expand Down
Loading

0 comments on commit 5fc4500

Please sign in to comment.