-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_functions.bash
More file actions
35 lines (30 loc) · 1.04 KB
/
Copy pathdot_functions.bash
File metadata and controls
35 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
archive() {
# Create a new archive from determined files using the concurrent data compression method on the current machine.
tar --create --ignore-failed-read --use-compress-program=pigz --verbose --file=archive.tar.gz -- "$@"
}
g() {
if [[ -z "$1" ]]; then
# Show the current user's name and email address in the main working tree.
printf "%s <%s>\\n" "$(git config user.name)" "$(git config user.email)"
# Show the working tree status.
git status --branch --short
else
git "$@"
fi
}
mkcd() {
# Create and change the current working directory at the same time.
mkdir --parents --verbose -- "$1" && cd -P -- "$1" || return
}
o() {
if [[ -z "$1" ]]; then
# Open the current working directory in a new detached program session.
detach "${BASH_ALIASES[open]:-open}" "${PWD}"
else
detach "${BASH_ALIASES[open]:-open}" "$@"
fi
}
pyformatting() {
# Format all input files and sort python import definitions within logical sections.
black --line-length=100 -- "$@" && isort --filter-files --profile=black -- "$@"
}