2024-07-17 12:18:27 +00:00
|
|
|
#!/bin/env fish
|
|
|
|
begin
|
|
|
|
set -l dir (status dirname)
|
|
|
|
source "$dir/../../Scripts/software.fish"
|
|
|
|
|
2024-07-17 14:04:57 +00:00
|
|
|
function configureSW -V dir
|
2024-07-17 12:18:27 +00:00
|
|
|
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]"
|
2024-07-29 22:52:55 +00:00
|
|
|
break
|
2024-07-17 12:18:27 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
BROWSER_BIN="$bin" \
|
2024-07-29 22:52:55 +00:00
|
|
|
EXTENSION_POLICY_DIR="$extensionRoot" \
|
2024-07-17 12:18:27 +00:00
|
|
|
bash "$dir/../Chromium/ytmdl.sh"
|
2024-07-29 22:52:55 +00:00
|
|
|
|
|
|
|
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
|
2024-07-17 12:18:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
runInstaller $argv
|
|
|
|
end
|