feat(profiles): add up to .zshrc
This commit is contained in:
@@ -117,6 +117,13 @@ phok() {
|
|||||||
|
|
||||||
# ---------- misc helpers ----------
|
# ---------- misc helpers ----------
|
||||||
mkcd(){ mkdir -p "$1" && cd "$1"; }
|
mkcd(){ mkdir -p "$1" && cd "$1"; }
|
||||||
|
up(){
|
||||||
|
local n="${1:-1}"
|
||||||
|
[[ "$n" =~ ^[0-9]+$ ]] || { echo "up: expects a number"; return 1; }
|
||||||
|
local path=""
|
||||||
|
for ((i=0; i<n; i++)); do path="../$path"; done
|
||||||
|
cd "$path" || return
|
||||||
|
}
|
||||||
extract(){
|
extract(){
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*.tar.gz|*.tgz) tar xzf "$1";;
|
*.tar.gz|*.tgz) tar xzf "$1";;
|
||||||
|
|||||||
Reference in New Issue
Block a user