From 25e362622ec3089f2dc2bfaf178d412bf96654aa Mon Sep 17 00:00:00 2001 From: sloane <1699281+sloanelybutsurely@users.noreply.github.com> Date: Thu, 14 Mar 2024 08:53:37 -0400 Subject: [PATCH] update worktree command with copy-on-write of elixir stuff --- .config/fish/functions/worktree.fish | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.config/fish/functions/worktree.fish b/.config/fish/functions/worktree.fish index 6da2f2d..f5b6b9c 100644 --- a/.config/fish/functions/worktree.fish +++ b/.config/fish/functions/worktree.fish @@ -16,7 +16,30 @@ function worktree git worktree add -b "$branchname" "../$dirname" end - if test -d "node_modules" - cp -Rc node_modules ../$dirname/node_modules + # Node projects + # if test -e "package.json" + # if test -d "node_modules" + # cp -Rc node_modules ../$dirname/node_modules + # end + # end + + # Elixir projects + if test -e "mix.exs" and + if test -d "_build" + cp -cR _build ../$dirname/ + end + if test -d "deps" + cp -cR deps ../$dirname/ + end end + + # typically untracked files + if test -e ".envrc" + cp .envrc ../$dirname/ + end + if test -e ".npmrc" + cp .npmrc ../$dirname/ + end + + cd ../$dirname end