@jswork/ushell-module-git 1.0.7 → 1.0.9

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 CHANGED
@@ -16,7 +16,7 @@ alias gpa='git push --all -u';
16
16
  alias gpt="git push origin --tags";
17
17
  alias gpd="git push origin --delete ";
18
18
 
19
- alias gaa='git add -A';
19
+ alias gaa='git add .';
20
20
  alias gcm='git commit -m ';
21
21
  alias gam='git commit -am ';
22
22
  alias goo='git checkout origin ';
package/modules/01-gcd.sh CHANGED
@@ -1,9 +1,20 @@
1
1
  #!/usr/bin/env bash
2
2
  GIT_URL=$1;
3
3
  dir=`basename $GIT_URL .git`;
4
+ orgname=`echo $GIT_URL | awk -F [:/] '{print$2}'`;
4
5
 
5
- if [ -d $dir ]; then
6
- cd $dir && git pull;
6
+ # A special case for `afeiship` org.
7
+ if [ $orgname == 'afeiship' ]; then
8
+ orgname='github';
9
+ fi
10
+
11
+ localdir="$HOME/$orgname/$dir";
12
+
13
+ # test local dir, if exists, cd to it and pull, else mkdir and clone
14
+ if [ -d $localdir ]; then
15
+ cd $localdir && git pull;
7
16
  else
17
+ subdir=`dirname $localdir`;
18
+ mkdir -p $subdir && cd $subdir;
8
19
  git clone $GIT_URL && cd $dir;
9
20
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/ushell-module-git",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Unix like shell module for git.",
5
5
  "main": "index.sh",
6
6
  "repository": {
@@ -28,8 +28,5 @@
28
28
  ],
29
29
  "scripts": {
30
30
  "release": "release-it"
31
- },
32
- "devDependencies": {
33
- "release-it": "^14.6.2"
34
31
  }
35
32
  }