bashly 0.6.6 → 0.6.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bashly/templates/lib/config.sh +16 -13
- data/lib/bashly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c47271e43a775ff08c071428540301ed1fa0656c7d58020c9825dfbc492804ef
|
4
|
+
data.tar.gz: fdc8ac40f1d18c2bc90ae4700fd0757e55132852bbdf8700a2829a02dd3be61c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aff1e0723cdfdc10c409697cb2c715a37382dc7dbef3da3afe3b0e45fc8c91255ffeda153d24a25aa3bdcdf67ff863cfa7bec4558f79fced3d3ff33dc720b4d1
|
7
|
+
data.tar.gz: 54aa504a25003ddf1331e39de9b68612d2fff39bedc93dfc09bc961254c6b4ba7beacadf90412af6d76f9159bffb48456b6d6e85e5c805864372221f2edfbe2e
|
@@ -20,8 +20,9 @@ config_init() {
|
|
20
20
|
# Get a value from the config.
|
21
21
|
# Usage: result=$(config_get hello)
|
22
22
|
config_get() {
|
23
|
-
key=$1
|
24
|
-
regex="^$key *= *(.+)$"
|
23
|
+
local key=$1
|
24
|
+
local regex="^$key *= *(.+)$"
|
25
|
+
local value=""
|
25
26
|
|
26
27
|
config_init
|
27
28
|
|
@@ -38,15 +39,16 @@ config_get() {
|
|
38
39
|
# Add or update a key=value pair in the config.
|
39
40
|
# Usage: config_set key value
|
40
41
|
config_set() {
|
41
|
-
key=$1
|
42
|
+
local key=$1
|
42
43
|
shift
|
43
|
-
value="$*"
|
44
|
+
local value="$*"
|
44
45
|
|
45
46
|
config_init
|
46
47
|
|
47
|
-
regex="^($key) *= *.+$"
|
48
|
-
output=""
|
49
|
-
found_key=""
|
48
|
+
local regex="^($key) *= *.+$"
|
49
|
+
local output=""
|
50
|
+
local found_key=""
|
51
|
+
local newline
|
50
52
|
|
51
53
|
while IFS= read -r line || [ -n "$line" ]; do
|
52
54
|
newline=$line
|
@@ -69,15 +71,14 @@ config_set() {
|
|
69
71
|
# Delete a key from the config.
|
70
72
|
# Usage: config_del key
|
71
73
|
config_del() {
|
72
|
-
key=$1
|
74
|
+
local key=$1
|
73
75
|
|
74
|
-
regex="^($key) *="
|
75
|
-
output=""
|
76
|
+
local regex="^($key) *="
|
77
|
+
local output=""
|
76
78
|
|
77
79
|
config_init
|
78
80
|
|
79
81
|
while IFS= read -r line || [ -n "$line" ]; do
|
80
|
-
newline=$line
|
81
82
|
if [[ $line ]] && [[ ! $line =~ $regex ]]; then
|
82
83
|
output="$output$line\n"
|
83
84
|
fi
|
@@ -100,11 +101,13 @@ config_show() {
|
|
100
101
|
# done
|
101
102
|
#
|
102
103
|
config_keys() {
|
103
|
-
regex="^([a-zA-Z0-9_\-\/\.]+) *="
|
104
|
+
local regex="^([a-zA-Z0-9_\-\/\.]+) *="
|
104
105
|
|
105
106
|
config_init
|
106
107
|
|
107
|
-
keys=()
|
108
|
+
local keys=()
|
109
|
+
local key
|
110
|
+
|
108
111
|
while IFS= read -r line || [ -n "$line" ]; do
|
109
112
|
if [[ $line =~ $regex ]]; then
|
110
113
|
key="${BASH_REMATCH[1]}"
|
data/lib/bashly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bashly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|