Skip to content

Commit

Permalink
docs: rewrite Readme.md after change cmd action
Browse files Browse the repository at this point in the history
  • Loading branch information
kozmod committed Feb 18, 2023
1 parent 5de405f commit 8baf63a
Showing 1 changed file with 22 additions and 47 deletions.
69 changes: 22 additions & 47 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ ___
| files.get.headers | map[string]string || request `Headers` |
| files.get.query_params | map[string]string || request `Query Parameters` |
| | | | |
| cmd`<unique_suffix>`[<sup>****</sup>](#Commands) | | | configuration command list |
| cmd.exec | []slice || list of command to execute |
| cmd`<unique_suffix>`[<sup>****</sup>](#Commands) | || configuration command list |
| cmd.exec | string || command to execution |
| cmd.args | []slice || list of command's arguments |
| cmd.dir | string || execution commands (`cmd.exec`) directory |
| cmd.pipe[<sup>****</sup>](#cmd_pipe) | bool || execution commands from `exec` section in 'pipe mode' |
| | | | |
| fs[<sup>****</sup>](#fs) | []string || execute [text/template.Option](https://pkg.go.dev/text/template#Template.Option) on the list of directories |

Expand Down Expand Up @@ -100,8 +100,8 @@ files:
# list commands to execution
cmd:
- exec: [ touch second_file.txt ]
- exec: [ tree ]
- touch second_file.txt
- tree
```
```console
Expand Down Expand Up @@ -134,11 +134,11 @@ with `<unique_suffix>` to separate action execution.
dirs1:
- api/some_project/v1
cmd1:
- exec: [ chmod -R 777 api ]
- chmod -R 777 api
dirs2:
- api/some_project_2/v1
cmd2:
- exec: [ chmod -R 777 api ]
- chmod -R 777 api
```
```console
Expand All @@ -161,7 +161,7 @@ flag `-dr` use to execute configuration in dry run mod. All `action` will be exe
dirs:
- api/{{ $project_name }}/v1
cmd:
- exec: [ chmod -R 777 api/v1 ]
- chmod -R 777 api/v1
files:
- path: api/v1/some_file.txt
Expand Down Expand Up @@ -198,15 +198,15 @@ expression.
dirs:
- api/v1
cmd:
- exec: [ chmod -R 777 api/v1 ]
- chmod -R 777 api/v1
dirs1:
- api/v2
cmd1:
- exec: [ chmod -R 777 api/v2 ]
- chmod -R 777 api/v2
dirs2:
- api/v3
cmd2:
- exec: [ chmod -R 777 api/v3 ]
- chmod -R 777 api/v3
```

```console
Expand Down Expand Up @@ -284,8 +284,11 @@ files:
{{$project_name}}
cmd:
- exec: [ "cat internal/{{$project_name}}.txt", ls -l, tree ]
- "cat internal/{{$project_name}}.txt"
- exec: ls
dir: .
args: [ -l ]
- exec: tree
```
```console
Expand Down Expand Up @@ -467,9 +470,11 @@ __Commands working directory__ calculate from the __application working director
## progen.yml

cmd:
- exec: [ ls -l ]
- exec: ls -l
args: [ - l ]
dir: .github/workflows
- exec: [ tree -L 1 ]
- exec: tree
args: [ -L, 1 ]
```
```console
Expand Down Expand Up @@ -515,32 +520,6 @@ cmd:
2023-02-15 17:56:58 INFO execute [dir: .]: ls -a
```
#### <a name="cmd_pipe"></a> 'Pipe mode'
The `cmd.pipe` option set "pipe mode" for `cmd.exec` section:
sequentially redirect an output of first command to an input of the second.

```yaml
## progen.yml
cmd:
- exec:
- ls /
- sort -r
- wc -l
pipe: true
dir: .
```

```console
% progen -v
2023-02-07 18:12:38 INFO application working directory: /Users/user_1/GoProjects/progen
2023-02-07 18:12:38 INFO configuration file: progen.yml
2023-02-07 18:12:38 INFO execute pipe [dir: .]: ls / | sort -r | wc -l
out:
17
```

___
### <a name="fs"></a>File System
Expand All @@ -555,20 +534,16 @@ var_d: VAR_d
var_f: VAR_f
cmd:
- exec:
- cp -a ../asserts/. ../out/
dir: .
- exec:
- tree
- cp -a ../asserts/. ../out/
- exec: tree
dir: .
fs:
- test_dir
- test_dir_2
cmd_finish:
- exec:
- tree
- exec: tree
dir: .
```

Expand Down

0 comments on commit 8baf63a

Please sign in to comment.