Last active
November 5, 2021 01:30
-
-
Save scmorrison/92b0f592683a840b8cc314852e417b5f to your computer and use it in GitHub Desktop.
Install latest Reaper on linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env raku | |
# | |
# File: install-reaper-latest.raku | |
# Summary: Download and install the latest | |
# version of Reaper from reaper.fm. | |
# | |
# Usage: | |
# ./install-reaper-latest.raku [--arch[=Any]] [--install_dir[=Any]] [--tmp_dir[=Any]] | |
use v6; | |
use WWW; | |
sub MAIN( | |
:$arch = 'linux_x86_64', | |
:$install_dir = '/opt', | |
:$tmp_dir = '/tmp/reaper_latest' | |
) { | |
my $root = "https://www.reaper.fm/"; | |
my $download_page = $root ~ "download.php"; | |
my $html = get $download_page; | |
my $file_url = $root ~ $html.match(/'files/' \d '.x/reaper' \d+ "_$arch.tar.xz" /).Str; | |
my $install_script = "{$tmp_dir}/reaper_{$arch}/install-reaper.sh"; | |
if $file_url !~~ '' { | |
# Delete existing reaper download directory | |
QX "rm -rf {$tmp_dir}/reaper_{$arch}"; | |
say "Downloading {$file_url}"; | |
mkdir $tmp_dir; | |
spurt "{$tmp_dir}/latest.tar.xz", get($file_url); | |
say "Extracting..."; | |
QX "tar -xf {$tmp_dir}/latest.tar.xz --directory {$tmp_dir}"; | |
if $install_script.IO.e { | |
say QX "sudo {$install_script} --install {$install_dir} --integrate-desktop"; | |
} else { | |
say "Reaper install script not found: {}"; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment