#!/bin/env fish
begin
    set -l dir (status dirname)
    source "$dir/../../lib/software.fish"

    function installSW
        configureSW
    end

    function configureSW
        sudo sed -i \
            -e '/^\[options\]$/,/^\[/{' \
                -e 's/^#\?\(Color\)$/\1/;' \
                -e '/^# Misc Options$/{' (
                    # -e "a ILoveCandy"
                ) \
                -e "};" \
            -e "}" \
            -e '/^#\?\[multilib\]$/,/^$/{ s/^#\?\(.*\)$/\1/; }' \
            /etc/pacman.conf

        sudo pacman -Sy
    end

    runInstaller --force $argv
end