From 35a9e08a7ed26b9b7ff34540de877508a98066eb Mon Sep 17 00:00:00 2001 From: Tomas Mirchev Date: Tue, 4 Nov 2025 05:30:30 +0200 Subject: [PATCH] feat(flow): add dotfiles --- config/shared/bin/flow | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/config/shared/bin/flow b/config/shared/bin/flow index ab14d86..4b05c00 100755 --- a/config/shared/bin/flow +++ b/config/shared/bin/flow @@ -26,6 +26,27 @@ SPEC=( "end" "end" + "command;dotfiles;Manage repository dotfiles and git submodules" + "command;init;Initialize and set up all submodules" + "note;Equivalent to: git submodule update --init --recursive" + "end" + "command;pull;Update all submodules to latest remote commits" + "note;Equivalent to: git submodule update --remote --recursive" + "end" + "command;urls;Synchronize submodule URLs" + "note;Equivalent to: git submodule sync --recursive" + "end" + "command;reset;Reset submodules to the recorded commits" + "note;Equivalent to: git submodule update --init --recursive --force" + "end" + "command;status;Show current submodule status" + "note;Equivalent to: git submodule status --recursive" + "end" + "command;all;Run URLs sync, initialization, and remote update in one step" + "note;Equivalent to: git submodule sync --recursive && git submodule update --init --recursive && git submodule update --remote --recursive" + "end" + "end" + "command;create;Create and start a new development container" "argument;image,i;required;type:option;help:Container image to use (with optional tag)" "argument;project,p;type:option;help:Path to local project directory" @@ -154,6 +175,42 @@ cmd() { barg_usage } +cmd_dotfiles_init() { + echo "[dotfiles] Initializing submodules..." + git submodule update --init --recursive +} + +cmd_dotfiles_pull() { + echo "[dotfiles] Updating submodules to latest remote commits..." + git submodule update --remote --recursive +} + +cmd_dotfiles_urls() { + echo "[dotfiles] Syncing submodule URLs..." + git submodule sync --recursive +} + +cmd_dotfiles_reset() { + echo "[dotfiles] Resetting submodules to recorded commits..." + git submodule update --init --recursive --force +} + +cmd_dotfiles_status() { + echo "[dotfiles] Submodule status:" + git submodule status --recursive +} + +cmd_dotfiles_all() { + echo "[dotfiles] Syncing URLs..." + git submodule sync --recursive + + echo "[dotfiles] Initializing submodules..." + git submodule update --init --recursive + + echo "[dotfiles] Updating submodules to latest remote commits..." + git submodule update --remote --recursive +} + # shellcheck disable=SC2154,SC2155 cmd_enter() { # VARS: user_arg, namespace_arg, platform_arg, target_arg, session_arg, no_tmux_arg, dry_run_arg, ssh_args_arg