Compare commits
3 commits
4be860e4cd
...
2eb03cf863
Author | SHA1 | Date | |
---|---|---|---|
2eb03cf863 | |||
cdac55a90b | |||
5a55cfba16 |
1 changed files with 31 additions and 14 deletions
45
cd.sh
45
cd.sh
|
@ -575,12 +575,28 @@ cd_write_python_module () {
|
||||||
cd_write "${CD_PYTHON_PACKAGES}/env.py" "\
|
cd_write "${CD_PYTHON_PACKAGES}/env.py" "\
|
||||||
$(cd_echo CD_OS_ID CD_OS_VERSION)
|
$(cd_echo CD_OS_ID CD_OS_VERSION)
|
||||||
|
|
||||||
|
STEP = ${CD_STEP}
|
||||||
|
|
||||||
$(cd_echo CD_OPEN CD_SHUT)
|
|
||||||
|
|
||||||
$(cd_echo CD_HORIZONTAL)
|
def open(*arguments):
|
||||||
|
print('${CD_OPEN}', end=str())
|
||||||
|
print(*arguments, flush=True)
|
||||||
|
|
||||||
$(cd_echo CD_DOWN CD_SPLIT CD_UP)
|
|
||||||
|
def shut(*arguments):
|
||||||
|
print('${CD_SHUT}', end=str())
|
||||||
|
print(*arguments, flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def split():
|
||||||
|
print('${CD_SPLIT}', flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def step(*arguments):
|
||||||
|
STEP += 1
|
||||||
|
print('${CD_DOWN}')
|
||||||
|
print('${CD_BOX_VERTICAL}', STEP, *arguments)
|
||||||
|
print('${CD_UP}', flush=True)
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,18 +615,11 @@ ${CD_GIT_CHILD}
|
||||||
|
|
||||||
# functions
|
# functions
|
||||||
|
|
||||||
cd_box_open () {
|
|
||||||
echo "${CD_OPEN}${@}"
|
|
||||||
}
|
|
||||||
cd_box_shut () {
|
|
||||||
echo "${CD_SHUT}${@}"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd_cat () {
|
cd_cat () {
|
||||||
if [ -f "${1}" ] ; then
|
if [ -f "${1}" ] ; then
|
||||||
cd_box_open "${1}"
|
cd_open "${1}"
|
||||||
cat "${1}" || exit
|
cat "${1}" || exit
|
||||||
cd_box_shut "${1}"
|
cd_shut "${1}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -660,9 +669,9 @@ local command="${1}"
|
||||||
|
|
||||||
cd_ls () {
|
cd_ls () {
|
||||||
if [ -d "${1}" ] ; then
|
if [ -d "${1}" ] ; then
|
||||||
cd_box_open "${1}"
|
cd_open "${1}"
|
||||||
ls -a -l "${1}" || exit
|
ls -a -l "${1}" || exit
|
||||||
cd_box_shut "${1}"
|
cd_shut "${1}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -673,6 +682,10 @@ cd_mkdir () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cd_open () {
|
||||||
|
echo "${CD_OPEN}${@}"
|
||||||
|
}
|
||||||
|
|
||||||
cd_openssl () {
|
cd_openssl () {
|
||||||
local file="${1}"
|
local file="${1}"
|
||||||
if [ -f "${file}" ] ; then
|
if [ -f "${file}" ] ; then
|
||||||
|
@ -702,6 +715,10 @@ shift
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cd_shut () {
|
||||||
|
echo "${CD_SHUT}${@}"
|
||||||
|
}
|
||||||
|
|
||||||
cd_split () {
|
cd_split () {
|
||||||
echo "${CD_SPLIT}"
|
echo "${CD_SPLIT}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue