You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- (optional, [see below](#configinfo-files-using-readmemd)) list commands with commnets: `cat bs/README.md`, `bat bs/README.md`, …
39
41
- using `bs`:
40
42
- Run command: `bs build some-argument`
41
43
- Lists commands: `bs .ls`
44
+
- create folder: `bs .mkdir`
45
+
- Cat README: `bs .cat`
46
+
47
+
### Organizing scripts
48
+
There are no rules, *it is all up to you*. But definitely
49
+
we can put together some *suggestions* to work with bs more
50
+
**happily**.
51
+
52
+
1. prefers **short names** without unnecessary
53
+
special characters (spaces, brackets, …)
54
+
1.*provide*`--help` options for your scripts
55
+
1.*use subdirectories* for subtasks
56
+
1.*use dots* in names for non-scripts (like `.config.js`,
57
+
`.common.js`, `.utils.js`, …)
58
+
1. provide `README.md` to comment your build scripts
42
59
60
+
```
61
+
bs/
62
+
├───build.js
63
+
├───build/
64
+
│ ├───html.js
65
+
│ └───sass.js
66
+
├───run.js
67
+
├───publish.js
68
+
├───.config.js
69
+
└───README.md
70
+
```
71
+
72
+
PS: You can create alias for task with:
73
+
```bash
74
+
ln -rfs bs/target bs/alias
75
+
```
76
+
77
+
### Build flows
43
78
Now focus on creating building flows. For parallel tasts, you can
44
79
use this pattern:
45
80
```bash
@@ -68,13 +103,6 @@ set -eou pipefail
68
103
cat src/*.js | manipulate > index.js
69
104
```
70
105
71
-
You can create alias for task with:
72
-
```bash
73
-
ln -rfs bs/target bs/alias
74
-
# optionaly
75
-
ln -rfs bs/.target.toml bs/.alias.toml
76
-
```
77
-
78
106
## `bs`
79
107
This is just a simple helper providing nice outputs
80
108
and make some operations easier.
@@ -86,31 +114,15 @@ You can find binaries on [Release](https://github.com/jaandrle/bs/releases/lates
86
114
87
115
Or use: `npm install https://github.com/jaandrle/bs --location=global`
88
116
89
-
### Config/Info files
90
-
You can create `.command.toml` file to describe `command`
91
-
and add additional configuration. Example:
92
-
```
93
-
buld.sh
94
-
.build.toml
95
-
```
96
-
```toml
97
-
#.build.toml
98
-
info= "Description of command"
99
-
default= true
100
-
101
-
[completions]
102
-
__all= [ "--help", "--version" ]
103
-
cmd= []
104
-
```
105
-
…all is optional. But:
106
-
-`info`: this text is listed aside of command name (e.g. `bs .ls`)
107
-
-`default`: this changes behavior of plain `bs`. By default it runs `.ls`, now it runs marked command
108
-
-`completions`: provide options for completions `bs .run build …`/`bs build …`
109
-
- `__all`: these options are listed for all sub-commands
110
-
- `cmd`: registers sub-command and its possible arguments (`bs .run build cmd …`)
117
+
### ~Config/Info files~ Using README.md
118
+
[This feature](https://github.com/jaandrle/bs/blob/adfbe3dc419b3189a1f9661d308c293b1e3b0514/README.md#configinfo-files) has been removed in version 0.8.
119
+
It seems to be better to use `bs/README.md` for comment your build scripts.
120
+
See example for current project [`bs/README.md`](./bs/README.md).
121
+
122
+
You can than use `cat bs/README.md` to get quick overview of available commands.
111
123
112
124
### `bs` synopsis
113
-
See [bs.js (line ≥24)](./bs.js#L24).
125
+
See [bs.js (line ≥31)](./bs.js#L31).
114
126
115
127
### `bs` completions
116
128
To allow completions just add `eval "$(bs .completion bash)"` to your `.bashrc`.
@@ -119,12 +131,8 @@ To allow completions just add `eval "$(bs .completion bash)"` to your `.bashrc`.
119
131
You can use [Git - Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to share your build scrips across your projects.
120
132
121
133
## WIP
122
-
-[x] provide `bs` binary
123
-
-[ ] some missing? commands in `bs` (maybe `.init`)
124
-
-[x] docs for `.command.toml` (`bs` completion)
125
-
-[x] docs for git submodules to share build scripts
134
+
-[ ] provide `bs` via npm
126
135
-[ ] docs for coexistence with others (such as `npm run`)
127
-
-[x] examples how to use bash for parallel/serial execution
128
136
129
137
## Acknowledgments
130
138
-[labaneilers/bs: The simplest possible build system using bash](https://github.com/labaneilers/bs)
0 commit comments