@jswork/ushell-module-git 1.0.65 → 1.0.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/ushell-module-git.iml" filepath="$PROJECT_DIR$/.idea/ushell-module-git.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/index.sh CHANGED
@@ -8,6 +8,7 @@ source $ROOT_PATH/modules/07-git-rebase.sh
8
8
  source $ROOT_PATH/modules/11-lazygit.sh
9
9
  source $ROOT_PATH/modules/14-gr.sh
10
10
  source $ROOT_PATH/modules/15-ignore-file.sh
11
+ source $ROOT_PATH/modules/16-wt.sh
11
12
 
12
13
  ## git base:
13
14
  alias gl='git pull'
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # wt CLI - Git Worktree Directory Switching
4
+ # https://github.com/yourusername/worktree-cli
5
+
6
+ # Check if wt binary exists
7
+ if command -v wt >/dev/null 2>&1; then
8
+
9
+ # 🚀 wt function for true directory switching
10
+ # This function overrides the wt binary to support real directory switching
11
+ wt() {
12
+ case "$1" in
13
+ switch|co)
14
+ # Handle switch/co commands for true directory switching
15
+ shift
16
+ local wt_cli="wt" # Use wt from PATH
17
+
18
+ # Get the path from wt switch command
19
+ local path
20
+ path=$($wt_cli switch "$@" 2>/dev/null)
21
+
22
+ # Check if we got a valid path (absolute path starts with /)
23
+ if [[ "$path" = /* ]] && [[ -d "$path" ]]; then
24
+ cd "$path" || return 1
25
+ echo "✅ Switched to: $path"
26
+ else
27
+ # Let the original command handle errors and display
28
+ $wt_cli switch "$@"
29
+ fi
30
+ ;;
31
+ *)
32
+ # Pass all other commands to wt binary
33
+ wt "$@"
34
+ ;;
35
+ esac
36
+ }
37
+
38
+ # Convenience alias
39
+ alias wtco='wt co' # Quick switch to worktree
40
+ alias wtl='wt switch --list' # List all worktrees
41
+
42
+ else
43
+ # wt binary not found - show installation message once
44
+ if [[ -z "$WT_SHOWN_MISSING" ]]; then
45
+ echo "⚠️ wt CLI not found in PATH"
46
+ echo "Install: go build -o wt main.go && sudo mv wt /usr/local/bin/wt"
47
+ export WT_SHOWN_MISSING=1
48
+ fi
49
+ fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/ushell-module-git",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "description": "Unix like shell module for git.",
5
5
  "main": "index.sh",
6
6
  "repository": {