forked from Shinonome/caelestia-cli
install: better discord install + fix broken links
Take any number of inputs Hardcode some custom clients For some reason test -e doesnt count broken links as existing idk why
This commit is contained in:
@@ -1,16 +1,10 @@
|
|||||||
#!/bin/fish
|
#!/bin/fish
|
||||||
|
|
||||||
if test -z "$argv[1]"
|
|
||||||
echo 'Usage: caelestia install discord <client_config_folder_name>'
|
|
||||||
exit 1
|
|
||||||
end
|
|
||||||
|
|
||||||
. (dirname (status filename))/util.fish
|
. (dirname (status filename))/util.fish
|
||||||
|
|
||||||
install-deps git
|
install-deps git
|
||||||
install-optional-deps 'arrpc (rich presence)'
|
install-optional-deps 'arrpc (rich presence)'
|
||||||
|
|
||||||
set -l client $CONFIG/$argv[1]
|
|
||||||
set -l dist $C_DATA/discord
|
set -l dist $C_DATA/discord
|
||||||
|
|
||||||
# Update/Clone repo
|
# Update/Clone repo
|
||||||
@@ -19,7 +13,13 @@ update-repo discord $dist
|
|||||||
# Install systemd service
|
# Install systemd service
|
||||||
setup-systemd-monitor discord $dist
|
setup-systemd-monitor discord $dist
|
||||||
|
|
||||||
# Link themes to client config
|
# Link themes to client configs
|
||||||
install-link $dist/themes $client/themes
|
set -l clients discord vesktop equibop legcord $argv
|
||||||
|
for client in $clients
|
||||||
|
if test -d $CONFIG/$client
|
||||||
|
log "Linking themes for $client"
|
||||||
|
install-link $dist/themes $CONFIG/$client/themes
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
log 'Done.'
|
log 'Done.'
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
. (dirname (status filename))/../util.fish
|
. (dirname (status filename))/../util.fish
|
||||||
|
|
||||||
function confirm-overwrite -a path
|
function confirm-overwrite -a path
|
||||||
if test -e $path
|
if test -e $path -o -L $path
|
||||||
read -l -p "input '$(realpath $path) already exists. Overwrite? [y/N] ' -n" confirm
|
read -l -p "input '$(realpath $path 2> /dev/null || echo $path) already exists. Overwrite? [y/N] ' -n" confirm
|
||||||
if test "$confirm" = 'y' -o "$confirm" = 'Y'
|
if test "$confirm" = 'y' -o "$confirm" = 'Y'
|
||||||
log 'Continuing.'
|
log 'Continuing.'
|
||||||
test -z "$argv[2]" && rm -rf $path # If a second arg is provided, don't delete
|
test -z "$argv[2]" && rm -rf $path # If a second arg is provided, don't delete
|
||||||
|
|||||||
Reference in New Issue
Block a user