diff --git a/bootstrap.sh b/cd-bootstrap.sh similarity index 60% rename from bootstrap.sh rename to cd-bootstrap.sh index 054d967..dbab7b6 100755 --- a/bootstrap.sh +++ b/cd-bootstrap.sh @@ -1,7 +1,3 @@ -FILE="$(realpath "${BASH_SOURCE[0]}")" -ROOT="$(dirname "${FILE}")" - -COMMANDS='cmd' KEY_ALGORITHM='ed25519' KEY_DIRECTORY='.ssh' KEY_PATH="${KEY_DIRECTORY}/id_${KEY_ALGORITHM}" @@ -12,15 +8,6 @@ PACKAGES=( 'tree' ) SERVER="$(basename ${GITHUB_SERVER_URL})" -TARGET='/usr/local/sbin' - -# commands -cd "${ROOT}/${COMMANDS}" \ -|| exit -for file in *.sh ; do - cp "${file}" "${TARGET}/${file%.sh}" \ - || exit -done # ssh cd \ @@ -37,8 +24,4 @@ echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \ || exit # packages -apt-get install --yes "${PACKAGES[@]}" \ -|| exit - -# remove -rm --force --recursive "${ROOT}" +apt-get install --yes "${PACKAGES[@]}" diff --git a/cmd/cd-browse-workspace.sh b/cd-browse-workspace similarity index 100% rename from cmd/cd-browse-workspace.sh rename to cd-browse-workspace diff --git a/cmd/cd-build-project.sh b/cd-build-project similarity index 100% rename from cmd/cd-build-project.sh rename to cd-build-project diff --git a/cmd/cd-clone-branch.sh b/cd-clone-branch similarity index 100% rename from cmd/cd-clone-branch.sh rename to cd-clone-branch diff --git a/cmd/cd-clone-python.sh b/cd-clone-python similarity index 100% rename from cmd/cd-clone-python.sh rename to cd-clone-python diff --git a/cmd/cd-install-packages.sh b/cd-install-packages similarity index 100% rename from cmd/cd-install-packages.sh rename to cd-install-packages diff --git a/cd-list-environment b/cd-list-environment new file mode 100755 index 0000000..e22987a --- /dev/null +++ b/cd-list-environment @@ -0,0 +1,2 @@ +unset TOP_SECRET +env | sort diff --git a/cmd/cd-synchronize.sh b/cd-synchronize similarity index 100% rename from cmd/cd-synchronize.sh rename to cd-synchronize diff --git a/cd.sh b/cd.sh index f04df33..583d97d 100644 --- a/cd.sh +++ b/cd.sh @@ -5,6 +5,7 @@ PACKAGES=( 'git' ) REPOSITORY='rwx.work/cd' +TARGET='/usr/local/sbin' for nameserver in "${NAMESERVERS[@]}" ; do echo "nameserver ${nameserver}" \ @@ -18,10 +19,9 @@ apt-get update \ apt-get install --yes "${PACKAGES[@]}" \ || exit -DIRECTORY="$(mktemp --directory)" \ -|| exit git clone \ "${GITHUB_SERVER_URL}/${REPOSITORY}" \ -"${DIRECTORY}" \ +"${TARGET}" \ || exit -"${DIRECTORY}/bootstrap.sh" + +cd-bootstrap.sh diff --git a/cmd/cd-list-environment.sh b/cmd/cd-list-environment.sh deleted file mode 100755 index dd3fd37..0000000 --- a/cmd/cd-list-environment.sh +++ /dev/null @@ -1 +0,0 @@ -env | sort