Browse Source

feat(bin/archuro): implement attach

master
Josh Habdas 1 year ago
parent
commit
8b4eb7c69f
Signed by: jhabdas GPG Key ID: B148B31154C75A74
5 changed files with 31 additions and 14 deletions
  1. +22
    -7
      bin/archuro
  2. BIN
      screenshots/archuro-demo-attach.mp4
  3. BIN
      screenshots/archuro-up-demo.mp4
  4. +8
    -6
      stow/dot-Brewfile
  5. +1
    -1
      stow/dot-hyper.js

+ 22
- 7
bin/archuro View File

@ -616,10 +616,10 @@ function print_help_message {
echo "COMMANDS"
echo
echo " ${green}attach${reset} ${grey}Attach to a running archlinux tty${reset}"
echo " ${green}init${reset} ${grey}Initialise build system${reset} ${green}-S, --stow${reset} ${grey}Stow dotfiles${reset}"
echo " ${green}install${reset} ${grey}Install dependencies${reset} ${green}-f, --force${reset} ${grey}Ingore conflicts${reset}"
echo " ${green}init${reset} ${grey}Initialise build system${reset} ${green}-S, --stow${reset} ${grey}Stow dotfiles${reset}"
echo " ${green}install${reset} ${grey}Install dependencies${reset} ${green}-f, --force${reset} ${grey}Ingore conflicts${reset}"
echo " ${green}ls${reset} ${grey}List available archlinux images${reset}"
echo " ${green}ps${reset} ${grey}Show archlinux containers${reset} ${green}-a, --all${reset} ${grey}Include stopped${reset}"
echo " ${green}ps${reset} ${grey}Show archlinux containers${reset} ${green}-q, --quiet${reset} ${grey}Only display numeric IDs${reset}"
echo " ${green}stop${reset} ${grey}Stop all running archlinux containers${reset}"
echo " ${green}tty${reset} ${grey}Start interactive archlinux tty${reset}"
echo " ${green}update${reset} ${grey}Update optional packages${reset}"
@ -639,7 +639,21 @@ if [ $# -eq 0 ]; then
else
case "$1" in
"attach" | "a")
echo "${bold}TODO${reset} impment ..."
attachid="$(archuro ps -q | head -1)"
if [[ -z "$attachid" ]]; then
echo "Cannot attach to a container. No running containers found."
echo "Do you wish to start a new archuro tty now?"
select yn in "Yes" "No"; do
case $yn in
Yes ) archuro tty; break;;
No ) exit;;
esac
done
else
echo "Running container ${attachid} found. Attaching ..."
sleep 3
docker attach "$attachid"
fi
;;
"init")
test "$2" = "-S" || test "$2" = "--stow" && UARG_STOW_DOTFILES=1
@ -681,11 +695,12 @@ else
;;
"ps")
case "$2" in
"-a" | "--all")
docker container ls | grep archlinux # XXX: --filter based on image tag 'archuro'
"-q" | "--quiet")
archuro ps | cut -c 1-12 | sed -n '1!p'
;;
*)
docker container ls -a | grep archlinux # XXX: --filter based on image tag 'archuro'
echo "CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS"
docker container ls | grep archlinux # XXX: --filter based on image tag 'archuro'
;;
esac
;;

BIN
screenshots/archuro-demo-attach.mp4 View File


BIN
screenshots/archuro-up-demo.mp4 View File


+ 8
- 6
stow/dot-Brewfile View File

@ -58,8 +58,9 @@ brew "tmux"
# 030 >>- DEVELOPER TOOLS
brew "cmake"
# mas "com.apple.dt.xcode", id: 497799835
brew "elasticsearch"
cask "elasticwolf"
# cask "adoptopenjdk8"
# brew "elasticsearch" # @requires [cask] adoptopenjdk8
# cask "elasticwolf"
brew "emacs"
brew "ffmpeg", args: ALL_FFMPEG_OPTIONS
brew "fzf"
@ -67,15 +68,16 @@ brew "git"
brew "go"
cask "graphql-playground"
brew "hugo"
brew "imagemagick"
brew "istioctl"
brew "jq"
brew "kubernetes-cli"
# brew "kubernetes-cli" Target /usr/local/bin/kubectl already exists via Docker Desktop.
brew "kubernetes-helm"
brew "kubernetes-service-catalog-client"
brew "mongodb"
brew "mongodb-compass"
# brew "mongodb"
# brew "mongodb-compass"
brew "mono"
brew "navicat-for-postgresql" # @see https://www.navicat.com/en/products/navicat-for-postgresql
# brew "navicat-for-postgresql" # @see https://www.navicat.com/en/products/navicat-for-postgresql
brew "neovim"
brew "openssl"
brew "pngquant"

+ 1
- 1
stow/dot-hyper.js View File

@ -172,7 +172,7 @@ module.exports = {
// `hyperpower`
// `@company/project`
// `project#1.0.1`
plugins: ["hyper-flat", "hyperpower"],
plugins: ["hyper-flat", "hyperpower", "verminal"],
// in development, you can create a directory under
// `~/.hyper_plugins/local/` and include it here

Loading…
Cancel
Save