@decaf-ts/utils 0.2.2 → 0.2.3

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,82 @@
1
+ #!/bin/bash -e
2
+
3
+ function ask_yes_or_no(){
4
+ # Test if there are enough arguments
5
+ if [[ $# -gt 2 ]]; then
6
+ exit 1
7
+ fi
8
+
9
+ local message="${1}"
10
+ local y="y"
11
+ local n="N"
12
+
13
+ # defaults to no if not otherwise specified
14
+ [[ $2 == "yes" ]] && local default="yes" && y="Y" && n="n" || local default="no"
15
+
16
+ read -p "$message ([$y]es or [$n]o): "
17
+ case $(echo $REPLY | tr '[A-Z]' '[a-z]') in
18
+ y|yes) local response="yes" ;;
19
+ *) local response="no" ;;
20
+ esac
21
+ if [[ $response == "$default" ]] || [[ -z $REPLY ]]; then
22
+ echo $default
23
+ else
24
+ echo $response
25
+ fi
26
+ }
27
+
28
+ function ask(){
29
+ # Test if there are enough arguments
30
+ if [[ $# -ne 1 ]]; then
31
+ exit 1
32
+ fi
33
+
34
+ local answer
35
+ local real_answer=""
36
+
37
+ while [[ "" == "$real_answer" ]]; do
38
+ read -p "Please type in $1: " answer
39
+ [[ "yes" == $(ask_yes_or_no "Is $answer you final answer?") ]] \
40
+ && real_answer="$answer"
41
+ done
42
+
43
+ echo "$real_answer"
44
+ }
45
+
46
+ if [[ $# -ne 0 ]];then
47
+ TAG="$1"
48
+ if [[ -n "$TAG" ]];then
49
+ shift
50
+ fi
51
+
52
+ MESSAGE="$*"
53
+ fi
54
+
55
+ echo "Preparing Release... "
56
+ npm run prepare-release
57
+
58
+ if [[ -z "$TAG" ]];then
59
+ echo "Listing existing tags..."
60
+ git tag --sort=-taggerdate | head -n 5
61
+ while [[ "$TAG" == "" || ! "${TAG}" =~ ^v[0-9]+\.[0-9]+.[0-9]+(\-[0-9a-zA-Z\-]+)?$ ]]; do
62
+ TAG=$(ask "What should be the new tag? (accepts v*.*.*[-...])")
63
+ done
64
+ fi
65
+
66
+ if [[ -z "$MESSAGE" ]];then
67
+ MESSAGE=$(ask "Tag Message")
68
+ fi
69
+
70
+ if [[ $(git status --porcelain) ]]; then
71
+ git add .
72
+ git commit -m "$TAG - $MESSAGE - after release preparation"
73
+ fi
74
+
75
+ npm version "$TAG" -m "$MESSAGE"
76
+
77
+ git push --follow-tags
78
+
79
+ if [[ "$MESSAGE" =~ -no-ci$ ]]; then
80
+ NPM_TOKEN=$(cat .npmtoken) npm publish --access public
81
+ fi
82
+
package/dist/utils.cjs CHANGED
@@ -3368,7 +3368,7 @@
3368
3368
  }
3369
3369
  }
3370
3370
 
3371
- const VERSION_STRING = "0.2.2";
3371
+ const VERSION_STRING = "0.2.3";
3372
3372
  var Modes;
3373
3373
  (function (Modes) {
3374
3374
  Modes["CJS"] = "commonjs";
@@ -4409,12 +4409,12 @@
4409
4409
  * @description Represents the current version of the module.
4410
4410
  * @summary This constant stores the version number of the @asdasdasd/utils module.
4411
4411
  * The actual version number is replaced during the build process,
4412
- * with the placeholder "0.2.2" being substituted with the current version.
4412
+ * with the placeholder "0.2.3" being substituted with the current version.
4413
4413
  *
4414
4414
  * @const VERSION
4415
4415
  * @memberOf module:@decaf-ts/utils
4416
4416
  */
4417
- const VERSION = "0.2.2";
4417
+ const VERSION = "0.2.3";
4418
4418
 
4419
4419
  exports.AbortCode = AbortCode;
4420
4420
  exports.BuildScripts = BuildScripts;