@runfile/cli 0.21.0 → 0.23.0

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.
@@ -224,6 +224,11 @@ but you can use it anywhere:
224
224
  { "if": "{{ ARGS.env != 'development' && ARGS.env != 'production' }}",
225
225
  "then": ["./deploy-staging.sh"] },
226
226
 
227
+ // Invert any boolean-returning value with unary `!` — including the
228
+ // comparison helpers (`less_than`, `is_number`, …) and `contains` etc.:
229
+ { "if": "{{ !is_number(ARGS.port) }}",
230
+ "then": ["echo 'port must be a number' && exit 1"] },
231
+
227
232
  // FLAGS.x works as a bare boolean inside DSL — no `== 'true'` needed:
228
233
  { "if": "{{ RUN.os == 'windows' && FLAGS.wsl }}",
229
234
  "then": "wsl --shell-type login -- vite build" },
@@ -259,10 +264,11 @@ and work as full substitution bodies *or* as chain segments:
259
264
  // trim : trim, trim_start, trim_end
260
265
  // inspect : length, starts_with, ends_with, contains
261
266
  // transform : escape, repeat, replace_all, remove_all
262
- // regex : regex_replace, regex_remove, regex_matches, regex_capture
267
+ // regex : regex_replace, regex_remove, regex_matches, regex_capture, regex_capture_all
263
268
  // build : concat, join
264
269
  // split : nth, first, last, count_parts
265
270
  // math : add, subtract, multiply, divide
271
+ // compare : less_than, less_than_or_equal, greater_than, greater_than_or_equal, is_number
266
272
  // validate : one_of
267
273
  // encoding : base64_encode, base64_decode
268
274
  // hashing : sha256, md5
@@ -284,6 +290,9 @@ and work as full substitution bodies *or* as chain segments:
284
290
  // greedy-replace trick needed. Group 0 is the whole match; group N is the
285
291
  // N-th `(...)`. Out-of-bounds returns "" (same convention as `nth`).
286
292
  "echo version={{ regex_capture(read_file('app/build.gradle.kts'), 'versionName = \"([^\"]+)\"', '1') }}",
293
+ // Pull group N out of EVERY match and join with a separator (the "all" variant
294
+ // of regex_capture). Here: every quoted dependency name, comma-separated.
295
+ "echo deps={{ regex_capture_all(read_file('deps.txt'), 'name = \"([^\"]+)\"', '1', ',') }}",
287
296
  // Split-by-separator scalar accessors — string in, string out, no list type:
288
297
  // basename idiom (last segment after `/`); empty string when input ends in `/`.
289
298
  "echo basename={{ last(ARGS.path, '/') }}",
@@ -314,6 +323,15 @@ and work as full substitution bodies *or* as chain segments:
314
323
  "echo next-build={{ add(VARS.versionCode, '1') }}",
315
324
  "echo half={{ divide(VARS.total, '2') }}",
316
325
 
326
+ // Numeric comparisons — coerce both args to numbers (same rules as the
327
+ // arithmetic family, so non-numeric input errors) and return "true"/"false",
328
+ // so they work as DSL `Truthy` values in `if` conditions:
329
+ // "if": "{{ greater_than(VARS.count, '50') }}"
330
+ // "if": "{{ less_than_or_equal(ARGS.retries, '3') }}"
331
+ // `is_number` tests whether a value parses as a (finite) number — it returns
332
+ // "false" instead of erroring on non-numeric input:
333
+ // "if": "{{ is_number(ARGS.port) }}"
334
+
317
335
  // Validate a value against a fixed allow-list. Returns the value on
318
336
  // match; lists every valid option in the error on mismatch. Collapses
319
337
  // the four-case `match { major: define(part, 'major'), ... }` boilerplate.
Binary file
@@ -224,6 +224,11 @@ but you can use it anywhere:
224
224
  { "if": "{{ ARGS.env != 'development' && ARGS.env != 'production' }}",
225
225
  "then": ["./deploy-staging.sh"] },
226
226
 
227
+ // Invert any boolean-returning value with unary `!` — including the
228
+ // comparison helpers (`less_than`, `is_number`, …) and `contains` etc.:
229
+ { "if": "{{ !is_number(ARGS.port) }}",
230
+ "then": ["echo 'port must be a number' && exit 1"] },
231
+
227
232
  // FLAGS.x works as a bare boolean inside DSL — no `== 'true'` needed:
228
233
  { "if": "{{ RUN.os == 'windows' && FLAGS.wsl }}",
229
234
  "then": "wsl --shell-type login -- vite build" },
@@ -259,10 +264,11 @@ and work as full substitution bodies *or* as chain segments:
259
264
  // trim : trim, trim_start, trim_end
260
265
  // inspect : length, starts_with, ends_with, contains
261
266
  // transform : escape, repeat, replace_all, remove_all
262
- // regex : regex_replace, regex_remove, regex_matches, regex_capture
267
+ // regex : regex_replace, regex_remove, regex_matches, regex_capture, regex_capture_all
263
268
  // build : concat, join
264
269
  // split : nth, first, last, count_parts
265
270
  // math : add, subtract, multiply, divide
271
+ // compare : less_than, less_than_or_equal, greater_than, greater_than_or_equal, is_number
266
272
  // validate : one_of
267
273
  // encoding : base64_encode, base64_decode
268
274
  // hashing : sha256, md5
@@ -284,6 +290,9 @@ and work as full substitution bodies *or* as chain segments:
284
290
  // greedy-replace trick needed. Group 0 is the whole match; group N is the
285
291
  // N-th `(...)`. Out-of-bounds returns "" (same convention as `nth`).
286
292
  "echo version={{ regex_capture(read_file('app/build.gradle.kts'), 'versionName = \"([^\"]+)\"', '1') }}",
293
+ // Pull group N out of EVERY match and join with a separator (the "all" variant
294
+ // of regex_capture). Here: every quoted dependency name, comma-separated.
295
+ "echo deps={{ regex_capture_all(read_file('deps.txt'), 'name = \"([^\"]+)\"', '1', ',') }}",
287
296
  // Split-by-separator scalar accessors — string in, string out, no list type:
288
297
  // basename idiom (last segment after `/`); empty string when input ends in `/`.
289
298
  "echo basename={{ last(ARGS.path, '/') }}",
@@ -314,6 +323,15 @@ and work as full substitution bodies *or* as chain segments:
314
323
  "echo next-build={{ add(VARS.versionCode, '1') }}",
315
324
  "echo half={{ divide(VARS.total, '2') }}",
316
325
 
326
+ // Numeric comparisons — coerce both args to numbers (same rules as the
327
+ // arithmetic family, so non-numeric input errors) and return "true"/"false",
328
+ // so they work as DSL `Truthy` values in `if` conditions:
329
+ // "if": "{{ greater_than(VARS.count, '50') }}"
330
+ // "if": "{{ less_than_or_equal(ARGS.retries, '3') }}"
331
+ // `is_number` tests whether a value parses as a (finite) number — it returns
332
+ // "false" instead of erroring on non-numeric input:
333
+ // "if": "{{ is_number(ARGS.port) }}"
334
+
317
335
  // Validate a value against a fixed allow-list. Returns the value on
318
336
  // match; lists every valid option in the error on mismatch. Collapses
319
337
  // the four-case `match { major: define(part, 'major'), ... }` boilerplate.
Binary file
@@ -224,6 +224,11 @@ but you can use it anywhere:
224
224
  { "if": "{{ ARGS.env != 'development' && ARGS.env != 'production' }}",
225
225
  "then": ["./deploy-staging.sh"] },
226
226
 
227
+ // Invert any boolean-returning value with unary `!` — including the
228
+ // comparison helpers (`less_than`, `is_number`, …) and `contains` etc.:
229
+ { "if": "{{ !is_number(ARGS.port) }}",
230
+ "then": ["echo 'port must be a number' && exit 1"] },
231
+
227
232
  // FLAGS.x works as a bare boolean inside DSL — no `== 'true'` needed:
228
233
  { "if": "{{ RUN.os == 'windows' && FLAGS.wsl }}",
229
234
  "then": "wsl --shell-type login -- vite build" },
@@ -259,10 +264,11 @@ and work as full substitution bodies *or* as chain segments:
259
264
  // trim : trim, trim_start, trim_end
260
265
  // inspect : length, starts_with, ends_with, contains
261
266
  // transform : escape, repeat, replace_all, remove_all
262
- // regex : regex_replace, regex_remove, regex_matches, regex_capture
267
+ // regex : regex_replace, regex_remove, regex_matches, regex_capture, regex_capture_all
263
268
  // build : concat, join
264
269
  // split : nth, first, last, count_parts
265
270
  // math : add, subtract, multiply, divide
271
+ // compare : less_than, less_than_or_equal, greater_than, greater_than_or_equal, is_number
266
272
  // validate : one_of
267
273
  // encoding : base64_encode, base64_decode
268
274
  // hashing : sha256, md5
@@ -284,6 +290,9 @@ and work as full substitution bodies *or* as chain segments:
284
290
  // greedy-replace trick needed. Group 0 is the whole match; group N is the
285
291
  // N-th `(...)`. Out-of-bounds returns "" (same convention as `nth`).
286
292
  "echo version={{ regex_capture(read_file('app/build.gradle.kts'), 'versionName = \"([^\"]+)\"', '1') }}",
293
+ // Pull group N out of EVERY match and join with a separator (the "all" variant
294
+ // of regex_capture). Here: every quoted dependency name, comma-separated.
295
+ "echo deps={{ regex_capture_all(read_file('deps.txt'), 'name = \"([^\"]+)\"', '1', ',') }}",
287
296
  // Split-by-separator scalar accessors — string in, string out, no list type:
288
297
  // basename idiom (last segment after `/`); empty string when input ends in `/`.
289
298
  "echo basename={{ last(ARGS.path, '/') }}",
@@ -314,6 +323,15 @@ and work as full substitution bodies *or* as chain segments:
314
323
  "echo next-build={{ add(VARS.versionCode, '1') }}",
315
324
  "echo half={{ divide(VARS.total, '2') }}",
316
325
 
326
+ // Numeric comparisons — coerce both args to numbers (same rules as the
327
+ // arithmetic family, so non-numeric input errors) and return "true"/"false",
328
+ // so they work as DSL `Truthy` values in `if` conditions:
329
+ // "if": "{{ greater_than(VARS.count, '50') }}"
330
+ // "if": "{{ less_than_or_equal(ARGS.retries, '3') }}"
331
+ // `is_number` tests whether a value parses as a (finite) number — it returns
332
+ // "false" instead of erroring on non-numeric input:
333
+ // "if": "{{ is_number(ARGS.port) }}"
334
+
317
335
  // Validate a value against a fixed allow-list. Returns the value on
318
336
  // match; lists every valid option in the error on mismatch. Collapses
319
337
  // the four-case `match { major: define(part, 'major'), ... }` boilerplate.
Binary file
@@ -224,6 +224,11 @@ but you can use it anywhere:
224
224
  { "if": "{{ ARGS.env != 'development' && ARGS.env != 'production' }}",
225
225
  "then": ["./deploy-staging.sh"] },
226
226
 
227
+ // Invert any boolean-returning value with unary `!` — including the
228
+ // comparison helpers (`less_than`, `is_number`, …) and `contains` etc.:
229
+ { "if": "{{ !is_number(ARGS.port) }}",
230
+ "then": ["echo 'port must be a number' && exit 1"] },
231
+
227
232
  // FLAGS.x works as a bare boolean inside DSL — no `== 'true'` needed:
228
233
  { "if": "{{ RUN.os == 'windows' && FLAGS.wsl }}",
229
234
  "then": "wsl --shell-type login -- vite build" },
@@ -259,10 +264,11 @@ and work as full substitution bodies *or* as chain segments:
259
264
  // trim : trim, trim_start, trim_end
260
265
  // inspect : length, starts_with, ends_with, contains
261
266
  // transform : escape, repeat, replace_all, remove_all
262
- // regex : regex_replace, regex_remove, regex_matches, regex_capture
267
+ // regex : regex_replace, regex_remove, regex_matches, regex_capture, regex_capture_all
263
268
  // build : concat, join
264
269
  // split : nth, first, last, count_parts
265
270
  // math : add, subtract, multiply, divide
271
+ // compare : less_than, less_than_or_equal, greater_than, greater_than_or_equal, is_number
266
272
  // validate : one_of
267
273
  // encoding : base64_encode, base64_decode
268
274
  // hashing : sha256, md5
@@ -284,6 +290,9 @@ and work as full substitution bodies *or* as chain segments:
284
290
  // greedy-replace trick needed. Group 0 is the whole match; group N is the
285
291
  // N-th `(...)`. Out-of-bounds returns "" (same convention as `nth`).
286
292
  "echo version={{ regex_capture(read_file('app/build.gradle.kts'), 'versionName = \"([^\"]+)\"', '1') }}",
293
+ // Pull group N out of EVERY match and join with a separator (the "all" variant
294
+ // of regex_capture). Here: every quoted dependency name, comma-separated.
295
+ "echo deps={{ regex_capture_all(read_file('deps.txt'), 'name = \"([^\"]+)\"', '1', ',') }}",
287
296
  // Split-by-separator scalar accessors — string in, string out, no list type:
288
297
  // basename idiom (last segment after `/`); empty string when input ends in `/`.
289
298
  "echo basename={{ last(ARGS.path, '/') }}",
@@ -314,6 +323,15 @@ and work as full substitution bodies *or* as chain segments:
314
323
  "echo next-build={{ add(VARS.versionCode, '1') }}",
315
324
  "echo half={{ divide(VARS.total, '2') }}",
316
325
 
326
+ // Numeric comparisons — coerce both args to numbers (same rules as the
327
+ // arithmetic family, so non-numeric input errors) and return "true"/"false",
328
+ // so they work as DSL `Truthy` values in `if` conditions:
329
+ // "if": "{{ greater_than(VARS.count, '50') }}"
330
+ // "if": "{{ less_than_or_equal(ARGS.retries, '3') }}"
331
+ // `is_number` tests whether a value parses as a (finite) number — it returns
332
+ // "false" instead of erroring on non-numeric input:
333
+ // "if": "{{ is_number(ARGS.port) }}"
334
+
317
335
  // Validate a value against a fixed allow-list. Returns the value on
318
336
  // match; lists every valid option in the error on mismatch. Collapses
319
337
  // the four-case `match { major: define(part, 'major'), ... }` boilerplate.
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.21.0",
3
+ "version": "0.23.0",
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",