@runfile/cli 0.22.0 → 0.24.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" },
@@ -263,6 +268,7 @@ and work as full substitution bodies *or* as chain segments:
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
@@ -317,6 +323,15 @@ and work as full substitution bodies *or* as chain segments:
317
323
  "echo next-build={{ add(VARS.versionCode, '1') }}",
318
324
  "echo half={{ divide(VARS.total, '2') }}",
319
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
+
320
335
  // Validate a value against a fixed allow-list. Returns the value on
321
336
  // match; lists every valid option in the error on mismatch. Collapses
322
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" },
@@ -263,6 +268,7 @@ and work as full substitution bodies *or* as chain segments:
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
@@ -317,6 +323,15 @@ and work as full substitution bodies *or* as chain segments:
317
323
  "echo next-build={{ add(VARS.versionCode, '1') }}",
318
324
  "echo half={{ divide(VARS.total, '2') }}",
319
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
+
320
335
  // Validate a value against a fixed allow-list. Returns the value on
321
336
  // match; lists every valid option in the error on mismatch. Collapses
322
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" },
@@ -263,6 +268,7 @@ and work as full substitution bodies *or* as chain segments:
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
@@ -317,6 +323,15 @@ and work as full substitution bodies *or* as chain segments:
317
323
  "echo next-build={{ add(VARS.versionCode, '1') }}",
318
324
  "echo half={{ divide(VARS.total, '2') }}",
319
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
+
320
335
  // Validate a value against a fixed allow-list. Returns the value on
321
336
  // match; lists every valid option in the error on mismatch. Collapses
322
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" },
@@ -263,6 +268,7 @@ and work as full substitution bodies *or* as chain segments:
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
@@ -317,6 +323,15 @@ and work as full substitution bodies *or* as chain segments:
317
323
  "echo next-build={{ add(VARS.versionCode, '1') }}",
318
324
  "echo half={{ divide(VARS.total, '2') }}",
319
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
+
320
335
  // Validate a value against a fixed allow-list. Returns the value on
321
336
  // match; lists every valid option in the error on mismatch. Collapses
322
337
  // the four-case `match { major: define(part, 'major'), ... }` boilerplate.
package/bin/linux-x64/run CHANGED
Binary file
package/bin/run.js CHANGED
@@ -5,24 +5,24 @@ const { spawnSync } = require('node:child_process');
5
5
 
6
6
  const KEY = process.platform + '-' + process.arch;
7
7
  const BINARIES = {
8
+ "linux-x64": "run",
9
+ "linux-arm64": "run",
8
10
  "darwin-arm64": "run",
9
11
  "darwin-x64": "run",
10
- "linux-arm64": "run",
11
- "linux-x64": "run",
12
- "win32-arm64": "run.exe",
13
- "win32-x64": "run.exe"
12
+ "win32-x64": "run.exe",
13
+ "win32-arm64": "run.exe"
14
14
  };
15
15
 
16
16
  const bin = BINARIES[KEY];
17
17
  if (!bin) {
18
- console.error(`runfile: unsupported platform ${KEY}. Supported: ${Object.keys(BINARIES).join(', ')}`);
18
+ console.error(`run: unsupported platform ${KEY}. Supported: ${Object.keys(BINARIES).join(', ')}`);
19
19
  process.exit(1);
20
20
  }
21
21
 
22
22
  const binPath = path.join(__dirname, KEY, bin);
23
23
  const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
24
24
  if (result.error) {
25
- console.error(`runfile: failed to spawn ${binPath}: ${result.error.message}`);
25
+ console.error(`run: failed to spawn ${binPath}: ${result.error.message}`);
26
26
  process.exit(1);
27
27
  }
28
28
  process.exit(result.status == null ? 1 : result.status);
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runfile/cli",
3
- "version": "0.22.0",
3
+ "version": "0.24.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",