Let's gooooooo
This commit is contained in:
parent
82a10a2802
commit
a757c003bf
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.generated
|
35
go
Executable file
35
go
Executable file
@ -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/⚡)
|
Loading…
Reference in New Issue
Block a user