PortValhalla/scripts/Common/Software/brave/main.fish

37 lines
1,015 B
Fish
Executable file

#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../../lib/software.fish"
function configureSW -V dir
set -l bin
set -l extensionRoot
set -l bins brave brave-beta brave-nightly
set -l \
extensionRoots \
/opt/brave-bin/extensions \
/opt/brave.com/brave-{beta,nightly}/extensions
for i in (seq (count $bins))
if type -q "$bins[$i]"
set bin "$bins[$i]"
set extensionRoot "$extensionRoots[$i]"
break
end
end
fish "$dir/../chromium/ytmdl.fish" "$bin" "$extensionRoot"
for i in (seq (count $bins))
if [ "$extensionRoots[$i]" != "$extensionRoot" ]
if [ -d "$extensionRoots[$i]" ]
sudo rm -rf "$extensionRoots[$i]"
sudo ln -s "$extensionRoot" "$extensionRoots[$i]"
end
end
end
end
runInstaller $argv
end