Compare commits
7 commits
2eb03cf863
...
c095fe57a2
Author | SHA1 | Date | |
---|---|---|---|
c095fe57a2 | |||
27a9b419d9 | |||
c1eaf978d7 | |||
5c9f50edfa | |||
d6f00d6945 | |||
916b7a56cd | |||
4fc693a17e |
3 changed files with 35 additions and 40 deletions
36
cd.sh
36
cd.sh
|
@ -573,30 +573,17 @@ ${CD_PYTHON_PACKAGES}
|
||||||
cd_write_python_module () {
|
cd_write_python_module () {
|
||||||
cd_step "Write Python module"
|
cd_step "Write Python module"
|
||||||
cd_write "${CD_PYTHON_PACKAGES}/env.py" "\
|
cd_write "${CD_PYTHON_PACKAGES}/env.py" "\
|
||||||
|
CD_STEP = ${CD_STEP}
|
||||||
|
|
||||||
|
|
||||||
|
$(cd_echo CD_DOWN CD_VERTICAL CD_UP)
|
||||||
|
|
||||||
|
$(cd_echo CD_OPEN CD_SHUT)
|
||||||
|
|
||||||
|
$(cd_echo CD_SPLIT)
|
||||||
|
|
||||||
|
|
||||||
$(cd_echo CD_OS_ID CD_OS_VERSION)
|
$(cd_echo CD_OS_ID CD_OS_VERSION)
|
||||||
|
|
||||||
STEP = ${CD_STEP}
|
|
||||||
|
|
||||||
|
|
||||||
def open(*arguments):
|
|
||||||
print('${CD_OPEN}', end=str())
|
|
||||||
print(*arguments, flush=True)
|
|
||||||
|
|
||||||
|
|
||||||
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)
|
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,7 +714,7 @@ cd_step () {
|
||||||
CD_STEP=$((CD_STEP+1))
|
CD_STEP=$((CD_STEP+1))
|
||||||
echo -n "\
|
echo -n "\
|
||||||
${CD_DOWN}
|
${CD_DOWN}
|
||||||
${CD_BOX_VERTICAL} ${CD_STEP} ${@}
|
${CD_VERTICAL} ${CD_STEP} ${@}
|
||||||
${CD_UP}
|
${CD_UP}
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
@ -772,6 +759,7 @@ CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}"
|
||||||
CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}"
|
CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}"
|
||||||
|
|
||||||
CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈"
|
CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈"
|
||||||
|
CD_VERTICAL="${CD_BOX_VERTICAL}"
|
||||||
|
|
||||||
CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}"
|
CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}"
|
||||||
CD_SPLIT="${CD_BOX_RIGHT}${CD_HORIZONTAL}"
|
CD_SPLIT="${CD_BOX_RIGHT}${CD_HORIZONTAL}"
|
||||||
|
|
|
@ -90,7 +90,8 @@ def install_commands(path):
|
||||||
|
|
||||||
def set_ssh(*arguments):
|
def set_ssh(*arguments):
|
||||||
ssh_key, ssh_hosts = arguments
|
ssh_key, ssh_hosts = arguments
|
||||||
ssh_type = projects.environment.get('CD_SSH_TYPE', 'ed25519')
|
#
|
||||||
|
ssh_type = 'ed25519'
|
||||||
#
|
#
|
||||||
home = os.path.expanduser('~')
|
home = os.path.expanduser('~')
|
||||||
#
|
#
|
||||||
|
@ -107,3 +108,24 @@ def set_ssh(*arguments):
|
||||||
if ssh_hosts:
|
if ssh_hosts:
|
||||||
fs.write(known, ssh_hosts)
|
fs.write(known, ssh_hosts)
|
||||||
os.chmod(known, 0o400)
|
os.chmod(known, 0o400)
|
||||||
|
|
||||||
|
|
||||||
|
def open(*arguments):
|
||||||
|
print(env.CD_OPEN, end=str())
|
||||||
|
print(*arguments, flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def shut(*arguments):
|
||||||
|
print(env.CD_SHUT, end=str())
|
||||||
|
print(*arguments, flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def split():
|
||||||
|
print(env.CD_SPLIT, flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def step(*arguments):
|
||||||
|
env.CD_STEP += 1
|
||||||
|
print(env.CD_DOWN)
|
||||||
|
print(env.CD_VERTICAL, env.CD_STEP, *arguments)
|
||||||
|
print(env.CD_UP, flush=True)
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
[ "${1}" ] && REPOSITORY_FULL="${1}" || exit
|
|
||||||
REPOSITORY_NAME="$(basename ${REPOSITORY_FULL})"
|
|
||||||
|
|
||||||
REPOSITORY_TEMP="$(mktemp --directory)"
|
|
||||||
|
|
||||||
git clone \
|
|
||||||
-- \
|
|
||||||
"${GITHUB_SERVER_URL}/${REPOSITORY_FULL}" \
|
|
||||||
"${REPOSITORY_TEMP}"
|
|
||||||
|
|
||||||
mv "${REPOSITORY_TEMP}/${REPOSITORY_NAME}" \
|
|
||||||
/usr/local/lib/python3.*/dist-packages/
|
|
||||||
|
|
||||||
rm --force --recursive \
|
|
||||||
"${REPOSITORY_TEMP}"
|
|
Loading…
Add table
Reference in a new issue