@runfile/cli 0.12.0 → 0.12.1

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.
@@ -167,9 +167,9 @@ $ run :env inject -f .env.production -- ./deploy.sh # encrypted values aut
167
167
 
168
168
  #### Powerful argument substitution
169
169
 
170
- Positional, named, flags, env vars, and runtime context (`{{ RUN.os }}` / `{{ RUN.shell }}` / `{{ RUN.cwd }}` /
171
- `{{ RUN.file }}` / `{{ RUN.parent }}`) — with chained fallbacks and required values. The `{{ ... }}` syntax
172
- avoids collisions with shell `$(...)` command substitution.
170
+ Positional, named, flags, env vars, and runtime context (`{{ RUN.os }}` / `{{ RUN.arch }}` / `{{ RUN.shell }}` /
171
+ `{{ RUN.cwd }}` / `{{ RUN.file }}` / `{{ RUN.parent }}`) — with chained fallbacks and required values. The
172
+ `{{ ... }}` syntax avoids collisions with shell `$(...)` command substitution.
173
173
 
174
174
  ```jsonc
175
175
  "PORT": "{{ ARGS.port ? ENV.PORT ? '3000' }}",
@@ -242,6 +242,7 @@ and work as full substitution bodies *or* as chain segments:
242
242
  // transform : escape, repeat, replace_all, remove_all
243
243
  // regex : regex_replace, regex_remove, regex_matches
244
244
  // build : concat, join
245
+ // split : nth, first, last, count_parts
245
246
  // encoding : base64_encode, base64_decode
246
247
  // shell : shell_quote
247
248
  // variables : define
@@ -253,6 +254,13 @@ and work as full substitution bodies *or* as chain segments:
253
254
  "go test {{ replace_all(ARGS.flags, ' ', ' -tag=') }}",
254
255
  // Strip every match of a regex (here: collapse whitespace runs to a single space):
255
256
  "echo {{ regex_replace(ARGS.text, '\\s+', ' ') }}",
257
+ // Split-by-separator scalar accessors — string in, string out, no list type:
258
+ // basename idiom (last segment after `/`); empty string when input ends in `/`.
259
+ "echo basename={{ last(ARGS.path, '/') }}",
260
+ // Pull out the N-th comma-separated field; out-of-bounds returns "".
261
+ "echo target={{ nth(ARGS.csv, ',', '1') }}",
262
+ // Pair `count_parts` with `nth` to bound-check before indexing:
263
+ // "if": "{{ count_parts(ARGS.csv, ',') == '3' }}"
256
264
  // Boolean-returning helpers are valid DSL `Truthy` values — use them in `if`:
257
265
  // "if": "{{ starts_with(ARGS.path, '/usr') }}"
258
266
  // "if": "{{ regex_matches(ARGS.tag, '^v[0-9]+\\.[0-9]+$') }}"
Binary file
@@ -167,9 +167,9 @@ $ run :env inject -f .env.production -- ./deploy.sh # encrypted values aut
167
167
 
168
168
  #### Powerful argument substitution
169
169
 
170
- Positional, named, flags, env vars, and runtime context (`{{ RUN.os }}` / `{{ RUN.shell }}` / `{{ RUN.cwd }}` /
171
- `{{ RUN.file }}` / `{{ RUN.parent }}`) — with chained fallbacks and required values. The `{{ ... }}` syntax
172
- avoids collisions with shell `$(...)` command substitution.
170
+ Positional, named, flags, env vars, and runtime context (`{{ RUN.os }}` / `{{ RUN.arch }}` / `{{ RUN.shell }}` /
171
+ `{{ RUN.cwd }}` / `{{ RUN.file }}` / `{{ RUN.parent }}`) — with chained fallbacks and required values. The
172
+ `{{ ... }}` syntax avoids collisions with shell `$(...)` command substitution.
173
173
 
174
174
  ```jsonc
175
175
  "PORT": "{{ ARGS.port ? ENV.PORT ? '3000' }}",
@@ -242,6 +242,7 @@ and work as full substitution bodies *or* as chain segments:
242
242
  // transform : escape, repeat, replace_all, remove_all
243
243
  // regex : regex_replace, regex_remove, regex_matches
244
244
  // build : concat, join
245
+ // split : nth, first, last, count_parts
245
246
  // encoding : base64_encode, base64_decode
246
247
  // shell : shell_quote
247
248
  // variables : define
@@ -253,6 +254,13 @@ and work as full substitution bodies *or* as chain segments:
253
254
  "go test {{ replace_all(ARGS.flags, ' ', ' -tag=') }}",
254
255
  // Strip every match of a regex (here: collapse whitespace runs to a single space):
255
256
  "echo {{ regex_replace(ARGS.text, '\\s+', ' ') }}",
257
+ // Split-by-separator scalar accessors — string in, string out, no list type:
258
+ // basename idiom (last segment after `/`); empty string when input ends in `/`.
259
+ "echo basename={{ last(ARGS.path, '/') }}",
260
+ // Pull out the N-th comma-separated field; out-of-bounds returns "".
261
+ "echo target={{ nth(ARGS.csv, ',', '1') }}",
262
+ // Pair `count_parts` with `nth` to bound-check before indexing:
263
+ // "if": "{{ count_parts(ARGS.csv, ',') == '3' }}"
256
264
  // Boolean-returning helpers are valid DSL `Truthy` values — use them in `if`:
257
265
  // "if": "{{ starts_with(ARGS.path, '/usr') }}"
258
266
  // "if": "{{ regex_matches(ARGS.tag, '^v[0-9]+\\.[0-9]+$') }}"
Binary file
@@ -167,9 +167,9 @@ $ run :env inject -f .env.production -- ./deploy.sh # encrypted values aut
167
167
 
168
168
  #### Powerful argument substitution
169
169
 
170
- Positional, named, flags, env vars, and runtime context (`{{ RUN.os }}` / `{{ RUN.shell }}` / `{{ RUN.cwd }}` /
171
- `{{ RUN.file }}` / `{{ RUN.parent }}`) — with chained fallbacks and required values. The `{{ ... }}` syntax
172
- avoids collisions with shell `$(...)` command substitution.
170
+ Positional, named, flags, env vars, and runtime context (`{{ RUN.os }}` / `{{ RUN.arch }}` / `{{ RUN.shell }}` /
171
+ `{{ RUN.cwd }}` / `{{ RUN.file }}` / `{{ RUN.parent }}`) — with chained fallbacks and required values. The
172
+ `{{ ... }}` syntax avoids collisions with shell `$(...)` command substitution.
173
173
 
174
174
  ```jsonc
175
175
  "PORT": "{{ ARGS.port ? ENV.PORT ? '3000' }}",
@@ -242,6 +242,7 @@ and work as full substitution bodies *or* as chain segments:
242
242
  // transform : escape, repeat, replace_all, remove_all
243
243
  // regex : regex_replace, regex_remove, regex_matches
244
244
  // build : concat, join
245
+ // split : nth, first, last, count_parts
245
246
  // encoding : base64_encode, base64_decode
246
247
  // shell : shell_quote
247
248
  // variables : define
@@ -253,6 +254,13 @@ and work as full substitution bodies *or* as chain segments:
253
254
  "go test {{ replace_all(ARGS.flags, ' ', ' -tag=') }}",
254
255
  // Strip every match of a regex (here: collapse whitespace runs to a single space):
255
256
  "echo {{ regex_replace(ARGS.text, '\\s+', ' ') }}",
257
+ // Split-by-separator scalar accessors — string in, string out, no list type:
258
+ // basename idiom (last segment after `/`); empty string when input ends in `/`.
259
+ "echo basename={{ last(ARGS.path, '/') }}",
260
+ // Pull out the N-th comma-separated field; out-of-bounds returns "".
261
+ "echo target={{ nth(ARGS.csv, ',', '1') }}",
262
+ // Pair `count_parts` with `nth` to bound-check before indexing:
263
+ // "if": "{{ count_parts(ARGS.csv, ',') == '3' }}"
256
264
  // Boolean-returning helpers are valid DSL `Truthy` values — use them in `if`:
257
265
  // "if": "{{ starts_with(ARGS.path, '/usr') }}"
258
266
  // "if": "{{ regex_matches(ARGS.tag, '^v[0-9]+\\.[0-9]+$') }}"
Binary file
@@ -167,9 +167,9 @@ $ run :env inject -f .env.production -- ./deploy.sh # encrypted values aut
167
167
 
168
168
  #### Powerful argument substitution
169
169
 
170
- Positional, named, flags, env vars, and runtime context (`{{ RUN.os }}` / `{{ RUN.shell }}` / `{{ RUN.cwd }}` /
171
- `{{ RUN.file }}` / `{{ RUN.parent }}`) — with chained fallbacks and required values. The `{{ ... }}` syntax
172
- avoids collisions with shell `$(...)` command substitution.
170
+ Positional, named, flags, env vars, and runtime context (`{{ RUN.os }}` / `{{ RUN.arch }}` / `{{ RUN.shell }}` /
171
+ `{{ RUN.cwd }}` / `{{ RUN.file }}` / `{{ RUN.parent }}`) — with chained fallbacks and required values. The
172
+ `{{ ... }}` syntax avoids collisions with shell `$(...)` command substitution.
173
173
 
174
174
  ```jsonc
175
175
  "PORT": "{{ ARGS.port ? ENV.PORT ? '3000' }}",
@@ -242,6 +242,7 @@ and work as full substitution bodies *or* as chain segments:
242
242
  // transform : escape, repeat, replace_all, remove_all
243
243
  // regex : regex_replace, regex_remove, regex_matches
244
244
  // build : concat, join
245
+ // split : nth, first, last, count_parts
245
246
  // encoding : base64_encode, base64_decode
246
247
  // shell : shell_quote
247
248
  // variables : define
@@ -253,6 +254,13 @@ and work as full substitution bodies *or* as chain segments:
253
254
  "go test {{ replace_all(ARGS.flags, ' ', ' -tag=') }}",
254
255
  // Strip every match of a regex (here: collapse whitespace runs to a single space):
255
256
  "echo {{ regex_replace(ARGS.text, '\\s+', ' ') }}",
257
+ // Split-by-separator scalar accessors — string in, string out, no list type:
258
+ // basename idiom (last segment after `/`); empty string when input ends in `/`.
259
+ "echo basename={{ last(ARGS.path, '/') }}",
260
+ // Pull out the N-th comma-separated field; out-of-bounds returns "".
261
+ "echo target={{ nth(ARGS.csv, ',', '1') }}",
262
+ // Pair `count_parts` with `nth` to bound-check before indexing:
263
+ // "if": "{{ count_parts(ARGS.csv, ',') == '3' }}"
256
264
  // Boolean-returning helpers are valid DSL `Truthy` values — use them in `if`:
257
265
  // "if": "{{ starts_with(ARGS.path, '/usr') }}"
258
266
  // "if": "{{ regex_matches(ARGS.tag, '^v[0-9]+\\.[0-9]+$') }}"
package/bin/linux-x64/run CHANGED
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runfile/cli",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Runfile CLI — an easy-to-use, batteries-included task runner",
5
5
  "repository": "https://github.com/Skiley/runfile",
6
6
  "homepage": "https://github.com/Skiley/runfile",