@jswork/ushell-module-git 1.0.19 → 1.0.20
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.
- package/index.sh +4 -1
- package/modules/08-mvg.sh +10 -0
- package/package.json +1 -1
package/index.sh
CHANGED
|
@@ -82,6 +82,9 @@ alias git-size="git count-objects -vH";
|
|
|
82
82
|
## add github cache:
|
|
83
83
|
alias github-cache='ssh-add ~/.ssh/id_rsa.github.com >/dev/null 2>/dev/null;';
|
|
84
84
|
|
|
85
|
+
## move subdirs to root:
|
|
86
|
+
alias mvg="${ROOT_PATH}/modules/08-mvg.sh";
|
|
87
|
+
|
|
85
88
|
# git-url-cli
|
|
86
89
|
# alias guc='git-url-cli'
|
|
87
90
|
|
|
@@ -91,4 +94,4 @@ alias github-cache='ssh-add ~/.ssh/id_rsa.github.com >/dev/null 2>/dev/null;';
|
|
|
91
94
|
# git-completion
|
|
92
95
|
if [ -f ~/.git-completion.bash ]; then
|
|
93
96
|
. ~/.git-completion.bash
|
|
94
|
-
fi
|
|
97
|
+
fi
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# 1. get subdirectory name
|
|
4
|
+
subdir=$(ls -d */ | awk '{printf $1}')
|
|
5
|
+
# 2. remove .git directory
|
|
6
|
+
cd $subdir && rm -rf .git && cd ..
|
|
7
|
+
# 3. move all files to parent directory
|
|
8
|
+
mv $subdir/{*,.[^.]*} .
|
|
9
|
+
# 4. remove subdirectory
|
|
10
|
+
rm -rf $subdir
|