From a757c003bf69e2e71c78e1e6aa1bb182df3a1008 Mon Sep 17 00:00:00 2001 From: vlad Date: Tue, 21 Feb 2023 22:42:11 -0800 Subject: [PATCH] Let's gooooooo --- .gitignore | 1 + go | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .gitignore create mode 100755 go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5f1e4d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.generated diff --git a/go b/go new file mode 100755 index 0000000..2134af5 --- /dev/null +++ b/go @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +_clone_or_pull() { + destination="$1" + repo="$2" + + mkdir -p "$destination" + ( + cd "$destination" + git init + git config --add remote.origin.url "$repo" + git config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + git fetch origin + ([[ -n "$(git branch -a --list origin/master)" ]] && git reset --hard "origin/master") || + ([[ -n "$(git branch -a --list origin/main)" ]] && git reset --hard "origin/main") + ) +} + +_pyenv() { + export PYENV_VERSION=3.9 + export PYENV_ROOT="$PWD/.generated/pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + + _clone_or_pull .generated/pyenv https://github.com/pyenv/pyenv.git + eval "$(pyenv init -)" + pyenv install --skip-existing $PYENV_VERSION +} + +⚡️chat() { + _pyenv + pip install --disable-pip-version-check -q shell-gpt + ./ai-chat +} + +source <(cat /tmp/⚡ 2> /dev/null || curl https://apps.ofvlad.xyz/⚡ | tee /tmp/⚡)