2020-10-31 22:16:56 +00:00
|
|
|
##!/usr/bin/env fish
|
|
|
|
# Uncomment this line and the last 2 lines of this file to enable running it like `./swim.fish`.
|
|
|
|
#
|
|
|
|
# This swim.fish script serves as a central place to store frequently run commands for this project.
|
|
|
|
# Replace Commands section with your own command functions.
|
|
|
|
# Source: https://github.com/mitchell/swim.fish
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
|
|
|
|
set -g cmd_func_prefix 'swim' # Set the function prefix for defining tasks
|
|
|
|
set -g fish_files \
|
|
|
|
./install_arch \
|
|
|
|
./provision_linux \
|
|
|
|
./sync \
|
|
|
|
./upgrade_debian \
|
|
|
|
./**.fish \
|
|
|
|
./.**.fish
|
|
|
|
|
|
|
|
# Commands
|
|
|
|
|
|
|
|
function swim_lint -d 'Lint fish scripts'
|
|
|
|
fish --no-execute $fish_files
|
|
|
|
end
|
|
|
|
|
|
|
|
function swim_format -d 'Format fish scripts'
|
|
|
|
fish_indent --write $fish_files
|
|
|
|
end
|
|
|
|
|
|
|
|
function swim_sync -d 'Run the sync script'
|
2020-10-31 23:00:45 +00:00
|
|
|
./sync $argv
|
2020-10-31 22:16:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function swim_install_arch -d 'Run the install_arch script'
|
2020-10-31 23:00:45 +00:00
|
|
|
./install_arch $argv
|
2020-10-31 22:16:56 +00:00
|
|
|
end
|
|
|
|
|
2020-10-31 23:00:45 +00:00
|
|
|
function swim_upgrade_debi -d 'Run the debian_upgrade script'
|
|
|
|
./upgrade_debian $argv
|
|
|
|
end
|
|
|
|
|
|
|
|
function swim_provision -d 'Run the provision_linux script with the specified distro'
|
|
|
|
argparse 'd/distro=' -- $argv
|
|
|
|
|
|
|
|
if test -n "$_flag_d"
|
|
|
|
set -g distro $_flag_d
|
2020-10-31 22:16:56 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
./provision_linux $argv[2..-1]
|
|
|
|
end
|
|
|
|
|
|
|
|
#curl -fsS https://raw.githubusercontent.com/mitchell/swim.fish/master/importable_sw.fish | source
|
|
|
|
#run_swim_command 'swim' $argv
|