@modernpoacher/deps 2.0.22 → 2.0.23

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/bin/deps.sh CHANGED
@@ -47,9 +47,18 @@ function can_update {
47
47
 
48
48
  if [ -z "$default_branch" ]
49
49
  then
50
- echo -e "Failed to identify the default branch for \033[0;35m$directory_name\033[0m"
50
+ default_branch=$(git remote show origin | awk '/HEAD branch/ {print $NF}')
51
51
 
52
- return 1
52
+ if [ -z "$default_branch" ]
53
+ then
54
+ echo -e "Failed to identify the default branch for \033[0;35m$directory_name\033[0m"
55
+
56
+ return 1
57
+ else
58
+ echo -e "The default branch for \033[0;35m$directory_name\033[0m is '$default_branch'"
59
+
60
+ return 0
61
+ fi
53
62
  else
54
63
  echo -e "The default branch for \033[0;35m$directory_name\033[0m is '$default_branch'"
55
64
 
package/bin/head.sh CHANGED
@@ -75,9 +75,18 @@ function can_git_remote_set_head {
75
75
 
76
76
  if [ -z "$default_branch" ]
77
77
  then
78
- echo -e "Failed to identify the default branch for \033[0;35m$directory_name\033[0m"
78
+ default_branch=$(git remote show origin | awk '/HEAD branch/ {print $NF}')
79
79
 
80
- return 1
80
+ if [ -z "$default_branch" ]
81
+ then
82
+ echo -e "Failed to identify the default branch for \033[0;35m$directory_name\033[0m"
83
+
84
+ return 1
85
+ else
86
+ echo -e "The default branch for \033[0;35m$directory_name\033[0m is '$default_branch'"
87
+
88
+ return 0
89
+ fi
81
90
  else
82
91
  echo -e "The default branch for \033[0;35m$directory_name\033[0m is '$default_branch'"
83
92
 
package/bin/push.sh CHANGED
@@ -17,17 +17,26 @@ function report {
17
17
  }
18
18
 
19
19
  function checkout_default_branch {
20
- DIR=$(echo "$PWD" | sed 's/\\/\//g' | sed 's/://') && [[ $(cat "$DIR/.git/refs/remotes/origin/HEAD" 2> /dev/null) =~ $EXP ]] && default_branch="${BASH_REMATCH[0]}"
21
-
22
20
  local directory_name
23
21
 
24
22
  directory_name="${1##*/}" # directory_name="$(basename "$(git rev-parse --show-toplevel)")"
25
23
 
24
+ DIR=$(echo "$PWD" | sed 's/\\/\//g' | sed 's/://') && [[ $(cat "$DIR/.git/refs/remotes/origin/HEAD" 2> /dev/null) =~ $EXP ]] && default_branch="${BASH_REMATCH[0]}"
25
+
26
26
  if [ -z "$default_branch" ]
27
27
  then
28
- echo -e "Failed to identify the default branch for \033[0;35m$directory_name\033[0m"
28
+ default_branch=$(git remote show origin | awk '/HEAD branch/ {print $NF}')
29
+
30
+ if [ -z "$default_branch" ]
31
+ then
32
+ echo -e "Failed to identify the default branch for \033[0;35m$directory_name\033[0m"
29
33
 
30
- return 1
34
+ return 1
35
+ else
36
+ echo -e "The default branch for \033[0;35m$directory_name\033[0m is '$default_branch'"
37
+
38
+ return 0
39
+ fi
31
40
  else
32
41
  echo -e "The default branch for \033[0;35m$directory_name\033[0m is '$default_branch'"
33
42
 
package/bin/wipe.sh CHANGED
@@ -17,17 +17,26 @@ function report {
17
17
  }
18
18
 
19
19
  function checkout_default_branch {
20
- DIR=$(echo "$PWD" | sed 's/\\/\//g' | sed 's/://') && [[ $(cat "$DIR/.git/refs/remotes/origin/HEAD" 2> /dev/null) =~ $EXP ]] && default_branch="${BASH_REMATCH[0]}"
21
-
22
20
  local directory_name
23
21
 
24
22
  directory_name="${1##*/}" # directory_name="$(basename "$(git rev-parse --show-toplevel)")"
25
23
 
24
+ DIR=$(echo "$PWD" | sed 's/\\/\//g' | sed 's/://') && [[ $(cat "$DIR/.git/refs/remotes/origin/HEAD" 2> /dev/null) =~ $EXP ]] && default_branch="${BASH_REMATCH[0]}"
25
+
26
26
  if [ -z "$default_branch" ]
27
27
  then
28
- echo -e "Failed to identify the default branch for \033[0;35m$directory_name\033[0m"
28
+ default_branch=$(git remote show origin | awk '/HEAD branch/ {print $NF}')
29
+
30
+ if [ -z "$default_branch" ]
31
+ then
32
+ echo -e "Failed to identify the default branch for \033[0;35m$directory_name\033[0m"
29
33
 
30
- return 1
34
+ return 1
35
+ else
36
+ echo -e "The default branch for \033[0;35m$directory_name\033[0m is '$default_branch'"
37
+
38
+ return 0
39
+ fi
31
40
  else
32
41
  echo -e "The default branch for \033[0;35m$directory_name\033[0m is '$default_branch'"
33
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modernpoacher/deps",
3
- "version": "2.0.22",
3
+ "version": "2.0.23",
4
4
  "description": "Update NPM package dependencies from the command line",
5
5
  "keywords": [
6
6
  "deps",
@@ -63,7 +63,7 @@
63
63
  "@babel/preset-env": "^7.21.5",
64
64
  "@babel/register": "^7.21.0",
65
65
  "chai": "^4.3.7",
66
- "core-js": "^3.30.1",
66
+ "core-js": "^3.30.2",
67
67
  "cross-env": "^7.0.3",
68
68
  "eslint": "^8.40.0",
69
69
  "eslint-config-standard": "^17.0.0",