git-rev-label 2.19.16 → 2.23.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/git-rev-label +12 -6
- package/package.json +26 -26
package/git-rev-label
CHANGED
|
@@ -21,8 +21,8 @@ shopt -s inherit_errexit
|
|
|
21
21
|
shopt -s lastpipe
|
|
22
22
|
shopt -s expand_aliases
|
|
23
23
|
|
|
24
|
-
VERSION=master-
|
|
25
|
-
VERSION_NPM=2.
|
|
24
|
+
VERSION=master-c23-g85b7fdc-b20
|
|
25
|
+
VERSION_NPM=2.23.20
|
|
26
26
|
|
|
27
27
|
## todo maybe use utils.bash from autorsync
|
|
28
28
|
function echomsg { echo $'\e[1;37m'"$@"$'\e[0m'; }
|
|
@@ -168,6 +168,7 @@ while (( $# > 0 )) ;do
|
|
|
168
168
|
-v() { --variables "$@"; }
|
|
169
169
|
--vars(){ --variables "$@"; }
|
|
170
170
|
;;
|
|
171
|
+
# --format) ##todo parse next argument as set_with_warn format "$1" via set_next_with_warn format
|
|
171
172
|
--format=*) set_with_warn format "${1##--format=}";;
|
|
172
173
|
--format-file=*) set_with_warn format "$(cat "${1##--format-file=}")";;
|
|
173
174
|
--format-from=*) set_with_warn format "$(cat "${1##--format-from=}")";;
|
|
@@ -312,9 +313,12 @@ requested_variables_to_be_evaluated(){
|
|
|
312
313
|
## Calculate only requested variables: parse $format, detect required vars, then calculate required variables.
|
|
313
314
|
requested_variables=$(echo "$format"| perl -ne '$var="[A-Za-z_][A-Za-z0-9_]+"; print "$1$2 " while m,\$(?:($var)|\{($var)\}),g')
|
|
314
315
|
echodbg requested_variables="$requested_variables"
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
needed_variables=$(
|
|
316
|
+
test -n "$requested_variables" || return
|
|
317
|
+
# shellcheck disable=SC2086 ## shellcheck cannot track variables usage because they are referenced individually
|
|
318
|
+
needed_variables=$(
|
|
319
|
+
grep -Fx -f <(echo "$requested_variables"|resolve_dependancies|space_newline) \
|
|
320
|
+
<(echo $FULL_LIST|space_newline)
|
|
321
|
+
)
|
|
318
322
|
echodbg needed_variables="$needed_variables"
|
|
319
323
|
func_variables_body="$(get_function_body variables)"
|
|
320
324
|
for varname in $needed_variables ;do
|
|
@@ -339,7 +343,9 @@ variables_always_calculated
|
|
|
339
343
|
########################################################
|
|
340
344
|
########## Handle non-maintenance actions ##############
|
|
341
345
|
default_action(){
|
|
342
|
-
|
|
346
|
+
# shellcheck disable=SC2046 ## The quotes would unquote this, we need unquoted expansion
|
|
347
|
+
# shellcheck disable=SC2086 ## Word splitting is intentional in this case
|
|
348
|
+
eval "$(requested_variables_to_be_evaluated)"
|
|
343
349
|
echo "$format" | expand_env_vars
|
|
344
350
|
}
|
|
345
351
|
if ! is_sourced ;then
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
"name": "git-rev-label",
|
|
3
|
+
"description": "Obtain information about Git repository revision in format like 'master-c73-gbbb6bec'",
|
|
4
|
+
"version":"2.23.20",
|
|
5
|
+
"homepage": "https://gitlab.com/kyb/git-rev-label",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"git",
|
|
8
|
+
"rev",
|
|
9
|
+
"revision",
|
|
10
|
+
"versioning"
|
|
11
|
+
],
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Ivan Kuvaldin",
|
|
14
|
+
"url": "https://gitlab.com/kyb"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://gitlab.com/kyb/git-rev-label"
|
|
19
|
+
},
|
|
20
|
+
"main": "./git-rev-label",
|
|
21
|
+
"bin": {
|
|
22
|
+
"git-rev-label": "./git-rev-label"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "./BUILD"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT"
|
|
28
28
|
}
|