bashly 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -6
- data/lib/bashly/templates/lib/config.sh +23 -0
- data/lib/bashly/version.rb +1 -1
- data/lib/bashly/views/command/command_filter.erb +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: 33745534735d1a93f143a68939db55de17d618457b6873e948149317671f772d
|
4
|
+
data.tar.gz: 4ab52cd6f154cce246454d924fb898e8a092b1d7bb6e171dc9ff95d8dccc46c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f15b8e87c30fcb1bbec774ac101ef3f3225313df181bc78ab1786baa833e0c972ac01c4f451d20c2661c8383d3924fce182f737aa4f0579edfd27e3f006fa511
|
7
|
+
data.tar.gz: 7c51c2fd0b9564ba1be0e6a7b71b01176bbdc936da9d5382479ecbffee7671dd06e3c3c6172647b1c40d0d09d03ab347fecfe5f7464d1e0b90a4b49094116a88
|
data/README.md
CHANGED
@@ -21,7 +21,9 @@ Create beautiful bash scripts from simple YAML configuration
|
|
21
21
|
Installation
|
22
22
|
--------------------------------------------------
|
23
23
|
|
24
|
-
|
24
|
+
```shell
|
25
|
+
$ gem install bashly
|
26
|
+
```
|
25
27
|
|
26
28
|
|
27
29
|
What is Bashly
|
@@ -56,9 +58,11 @@ Usage
|
|
56
58
|
|
57
59
|
In an empty directory, create a sample configuration file by running
|
58
60
|
|
59
|
-
|
60
|
-
|
61
|
-
|
61
|
+
```shell
|
62
|
+
$ bashly init
|
63
|
+
# or, to generate a simpler configuration:
|
64
|
+
$ bashly init --minimal
|
65
|
+
```
|
62
66
|
|
63
67
|
This will create a sample `src/bashly.yml` file.
|
64
68
|
You can edit this file to specify which arguments, flags and subcommands you
|
@@ -67,7 +71,9 @@ need in your bash script.
|
|
67
71
|
Then, generate an initial bash script and function placeholder scripts by
|
68
72
|
running
|
69
73
|
|
70
|
-
|
74
|
+
```shell
|
75
|
+
$ bashly generate
|
76
|
+
```
|
71
77
|
|
72
78
|
This will:
|
73
79
|
|
@@ -198,7 +204,7 @@ The below configuration generates this flag:
|
|
198
204
|
Specify the output directory
|
199
205
|
```
|
200
206
|
|
201
|
-
The
|
207
|
+
The flag's value will be available to you as `${args[--output]}` in your
|
202
208
|
bash function (regardless of whether the user provided ut with the long or
|
203
209
|
short form).
|
204
210
|
|
@@ -91,3 +91,26 @@ config_show() {
|
|
91
91
|
config_init
|
92
92
|
cat "$CONFIG_FILE"
|
93
93
|
}
|
94
|
+
|
95
|
+
# Return an array of the keys in the config file
|
96
|
+
# Usage:
|
97
|
+
#
|
98
|
+
# for k in $(config_keys); do
|
99
|
+
# echo "- $k = $(config_get "$k")";
|
100
|
+
# done
|
101
|
+
#
|
102
|
+
config_keys() {
|
103
|
+
key=$1
|
104
|
+
regex="^(.*)\s*="
|
105
|
+
|
106
|
+
config_init
|
107
|
+
|
108
|
+
keys=()
|
109
|
+
while IFS= read -r line || [ -n "$line" ]; do
|
110
|
+
if [[ $line =~ $regex ]]; then
|
111
|
+
key="${BASH_REMATCH[1]}"
|
112
|
+
keys+=("$key")
|
113
|
+
fi
|
114
|
+
done < "$CONFIG_FILE"
|
115
|
+
echo ${keys[@]}
|
116
|
+
}
|
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.2.
|
4
|
+
version: 0.2.2
|
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: 2019-11-
|
11
|
+
date: 2019-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colsole
|