...
 
Commits (2)
set -gx PATH ~/config/fish/scripts ~/.pyenv/shims ~/.cargo/bin ~/.local/bin ~/.npm-global/bin ~/.go-global/bin ~/Library/Python/*/bin ~/.gem/ruby/*/bin /usr/local/bin $PATH
set -gx PATH /usr/local/bin $PATH
status --is-interactive; and source (pyenv init -|psub)
set -gx PATH ~/config/fish/scripts ~/.local/bin ~/.cargo/bin ~/.npm-global/bin ~/.go-global/bin ~/.gem/ruby/*/bin $PATH
source ~/.poetry/env
if test -d /usr/local/opt/android-sdk
set -gx ANDROID_HOME /usr/local/opt/android-sdk
......@@ -12,8 +15,6 @@ set -gx PYTHONDONTWRITEBYTECODE
set -gx EDITOR "vim"
eval (python3 -m virtualfish auto_activation global_requirements environment)
status --is-interactive; and source (pyenv init -|psub)
set -x GLOBAL_GOPATH $HOME/.go-global/
set -x GOPATH $GLOBAL_GOPATH
......@@ -26,3 +27,12 @@ if test -d $HOME/Library/Android/sdk
end
functions -e open # turn off Fish's open command, it's not necessary on OS X
function __check_git_email --on-variable PWD
if test -d .git -a (count (git config user.email)) -eq 0
echo (set_color red)"You need to set a Git user.email!"
echo "Run the following command:"
echo
echo " git config user.email <email>"
echo (set_color normal)
end
end
# Defined in /var/folders/w7/5ysspdvj03qc3qmsrnn4b4hr0000gn/T//fish.zXSvCF/fish_prompt.fish @ line 2
# Defined in /var/folders/dq/2_62hfn515l6g1_nscpfjjcw0000gn/T//fish.duEm2p/fish_prompt.fish @ line 2
function fish_prompt --description 'Write out the prompt'
set _status $status
# Empty line
......@@ -47,6 +47,11 @@ function fish_prompt --description 'Write out the prompt'
echo -s (set_color yellow) "gopath: " (basename "$GOPATH")
end
# Pyenv line
if pyenv local ^/dev/null >/dev/null
echo -s (set_color yellow) "pyenv: " (pyenv local | tr "\n" " ")
end
# Docker Machine line
if set -q DOCKER_MACHINE_NAME
echo -s (set_color purple) "docker-machine: " $DOCKER_MACHINE_NAME
......
# Defined in - @ line 0
function logout_test_account --description alias\ logout_test_account\ sudo\ kill\ -9\ \(ps\ awwwwux\ \|\ awk\ \'/test/\ \&\&\ /loginwind\[o\]w/\ \{print\ \$2\}\'\)
sudo kill -9 (ps awwwwux | awk '/test/ && /loginwind[o]w/ {print $2}') $argv;
end
# Defined in /var/folders/dq/2_62hfn515l6g1_nscpfjjcw0000gn/T//fish.zUVUsA/pgimport.fish @ line 2
function pgimport
if createdb $argv[2] -T template0
pg_restore -Ox1e -d $argv[2] $argv[1]
or dropdb $argv[2]
end
end
function redis-num
set name $argv[1]
set dbnum (redis-cli get "dbnum.$name")
if test $dbnum != ""
echo "redis:///$dbnum"
else
set dbnum (redis-cli incr dbnum.__unused)
redis-cli set dbnum.$name $dbnum
echo "redis:///$dbnum"
end
end
#!/usr/bin/env pyscript tomlkit click --
import click
import tomlkit
import subprocess
@click.command()
@click.argument("package")
@click.argument("version", default=None, required=False)
def main(package, version):
with open('pyproject.toml') as f:
toml = tomlkit.loads(f.read())
# TODO: preserve extras
del toml['tool']['poetry']['dependencies'][package]
with open('pyproject.toml', 'w') as f:
f.write(tomlkit.dumps(toml))
if version is not None:
subprocess.check_call(('poetry', 'add', f'{package}={version}'))
else:
subprocess.check_call(('poetry', 'add', package))
if __name__ == "__main__":
main()
\ No newline at end of file
#!/usr/bin/env pyscript tomlkit --
import tomlkit
import subprocess
import sys
subprocess.check_call(("poetry", "version", *sys.argv[1:]))
with open('pyproject.toml') as f:
new_version = tomlkit.parse(f.read())['tool']['poetry']['version']
subprocess.check_call(("git", "add", "pyproject.toml"))
subprocess.check_call(("git", "commit", "-m", f"Release {new_version}"))
subprocess.check_call(("git", "tag", new_version))
if input("OK to push? y/n ") == "y":
subprocess.check_call(("git", "push", "origin", "master", new_version))