diff --git a/.config/fish/completions/nvm.fish b/.config/fish/completions/nvm.fish index 14be1b7..c0ab183 100644 --- a/.config/fish/completions/nvm.fish +++ b/.config/fish/completions/nvm.fish @@ -4,15 +4,15 @@ complete --command nvm --exclusive --long help --description "Print help" complete --command nvm --long silent --description "Suppress standard output" complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version" -complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell" -complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions" -complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install" -complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version" +complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate a version in the current shell" +complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed versions" +complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List versions available to install matching optional regex" +complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version" complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "( test -e $nvm_data && string split ' ' <$nvm_data/.index )" complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')" -complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version" +complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall a version" complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "( _nvm_list | string split ' ' | string replace system '' )" diff --git a/.config/fish/conf.d/nvm.fish b/.config/fish/conf.d/nvm.fish index e060f2f..8aab50a 100644 --- a/.config/fish/conf.d/nvm.fish +++ b/.config/fish/conf.d/nvm.fish @@ -1,17 +1,17 @@ -set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist -set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share -set --global nvm_data $XDG_DATA_HOME/nvm - function _nvm_install --on-event nvm_install + set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist + set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share + set --universal nvm_data $XDG_DATA_HOME/nvm + test ! -d $nvm_data && command mkdir -p $nvm_data echo "Downloading the Node distribution index..." 2>/dev/null _nvm_index_update end function _nvm_update --on-event nvm_update - set --query --universal nvm_data && set --erase --universal nvm_data - set --query --universal nvm_mirror && set --erase --universal nvm_mirror - set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist + set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist + set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share + set --universal nvm_data $XDG_DATA_HOME/nvm end function _nvm_uninstall --on-event nvm_uninstall diff --git a/.config/fish/config.fish b/.config/fish/config.fish index cfbd2c2..98aff02 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -15,7 +15,7 @@ fish_add_path --append \ if command -s pyenv > /dev/null set -Ux PYENV_ROOT $HOME/.pyenv fish_add_path --move $PYENV_ROOT/bin - + pyenv init - | source end diff --git a/.config/fish/functions/nvm.fish b/.config/fish/functions/nvm.fish index 179dc45..131a030 100644 --- a/.config/fish/functions/nvm.fish +++ b/.config/fish/functions/nvm.fish @@ -29,31 +29,26 @@ function nvm --description "Node version manager" switch "$cmd" case -v --version - echo "nvm, version 2.2.13" + echo "nvm, version 2.2.11" case "" -h --help echo "Usage: nvm install Download and activate the specified Node version" - echo " nvm install Install the version specified in the nearest .nvmrc file" - echo " nvm use Activate the specified Node version in the current shell" - echo " nvm use Activate the version specified in the nearest .nvmrc file" - echo " nvm list List installed Node versions" - echo " nvm list-remote List available Node versions to install" - echo " nvm list-remote List Node versions matching a given regex pattern" - echo " nvm current Print the currently-active Node version" - echo " nvm uninstall Uninstall the specified Node version" + echo " nvm install Install version from nearest .nvmrc file" + echo " nvm use Activate a version in the current shell" + echo " nvm use Activate version from nearest .nvmrc file" + echo " nvm list List installed versions" + echo " nvm list-remote List versions available to install" + echo " nvm list-remote List versions matching a given regular expression" + echo " nvm current Print the currently-active version" + echo " nvm uninstall Uninstall a version" echo "Options:" - echo " -s, --silent Suppress standard output" - echo " -v, --version Print the version of nvm" - echo " -h, --help Print this help message" + echo " -s or --silent Suppress standard output" + echo " -v or --version Print version" + echo " -h or --help Print this help message" echo "Variables:" echo " nvm_arch Override architecture, e.g. x64-musl" - echo " nvm_mirror Use a mirror for downloading Node binaries" + echo " nvm_mirror Use a mirror of the Node binaries" echo " nvm_default_version Set the default version for new shells" - echo " nvm_default_packages Install a list of packages every time a Node version is installed" - echo "Examples:" - echo " nvm install latest Install the latest version of Node" - echo " nvm use 14.15.1 Use Node version 14.15.1" - echo " nvm use system Activate the system's Node version" - + echo " nvm_default_packages Install a list of packages every time you install a Node version" case install _nvm_index_update @@ -200,7 +195,8 @@ end function _nvm_version_match --argument-names ver string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver | string replace --filter --regex -- '^v?(\d+)' 'v$1' | - string escape --style=regex || string lower '\b'$ver'(?:/\w+)?$' + string escape --style=regex || + string lower '\b'$ver'(?:/\w+)?$' end function _nvm_list_format --argument-names current regex @@ -229,6 +225,6 @@ function _nvm_node_info command node --eval " console.log(process.version) console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version) - console.log(process.execPath) - " | string replace -- ~ \~ + console.log(process.execPath.replace(require('os').homedir(), '~')) + " end diff --git a/coder-setup.py b/coder-setup.py index 538550c..3b2a770 100644 --- a/coder-setup.py +++ b/coder-setup.py @@ -69,10 +69,11 @@ def restore_pip(): def configure_python(): backup_pip() try: - run("python3", "-m", "pip", "install", "--user", "pipx") - run("python3", "-m", "pipx", "ensurepath") - run("/home/coder/.local/bin/pipx", "install", "poetry") + run("pip3", "install", "black") run("sudo", "npm", "install", "-g", "prettier", "pyright") + + installer = urllib.request.urlopen("https://install.python-poetry.org").read() + subprocess.run(["python3", "-"], input=installer, check=True) finally: restore_pip()