<commit_before>is_wsl; or exit

set -l aliases \
  multipass \
  neovide \
  ykman
set -l alias_commands \
  "multipass.exe" \
  "neovide.exe --wsl" \
  "ykman.exe"

while count $aliases >/dev/null
  alias $aliases[1] $alias_commands[1]
  set -e aliases[1]; set -e alias_commands[1] # FIXME: old fish can't erase two variables in one command
end<commit_msg>fish: optimize creation of wsl aliases<commit_after>is_wsl; or exit

set -l aliases \
  cmd \
  multipass \
  neovide \
  powershell \
  wsl \
  ykman
set -l alias_commands \
  "cmd.exe" \
  "multipass.exe" \
  "neovide.exe --wsl" \
  "powershell.exe" \
  "wsl.exe" \
  "ykman.exe"

while count $aliases >/dev/null
  set -l alias $aliases[1]; set -e aliases[1]
  set -l command (string split ' ' $alias_commands[1]); set -e alias_commands[1]

  printf 'function %s -d "wsl wrapper for %s" -w %s; %s $argv; end' \
     $alias $command[1] $command[1] "$command" \
 | source
end
{'fraction_non_alphanumeric': 0.14163090128755365, 'fraction_numerical': 0.01072961373390558, 'mean_word_length': 2.970212765957447, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6265554', 'n_tokens_mistral': 391, 'n_tokens_neox': 379, 'n_words': 105}