@runfile/cli 0.28.0 → 0.31.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.
@@ -277,7 +277,7 @@ and work as full substitution bodies *or* as chain segments:
277
277
  // encoding : base64_encode, base64_decode, url_encode, url_decode
278
278
  // hashing : sha256, md5
279
279
  // ids/time : uuid, now
280
- // files : read_file, write_file, file_exists
280
+ // files : read_file, write_file, file_exists, temp_file, temp_dir
281
281
  // json : json_get, json_set
282
282
  // control : try, error
283
283
  // shell : shell_quote, capture
@@ -382,6 +382,17 @@ and work as full substitution bodies *or* as chain segments:
382
382
  // `printf > file`-style redirect on Windows. `--dry-run` skips the write.
383
383
  "{{ write_file('build.gradle.kts', regex_replace(read_file('build.gradle.kts'), 'versionCode = [0-9]+', 'versionCode = 43')) }}",
384
384
 
385
+ // Create a temp file / dir in the OS temp directory, auto-deleted when the
386
+ // CLI exits. `temp_file([content], [extension])` writes `content` (if given)
387
+ // and appends `.<extension>` (leading dot optional); `temp_dir()` makes an
388
+ // empty directory (removed recursively). `--dry-run` → `<temp_file>` /
389
+ // `<temp_dir>` placeholders, nothing created. Capture the path once with
390
+ // `define` and reuse it:
391
+ "{{ define(cfg, temp_file('{\"env\":\"prod\"}', 'json')) }}",
392
+ "tool --config {{ VAR.cfg }}",
393
+ "{{ define(work, temp_dir()) }}",
394
+ "git clone --depth 1 $REPO {{ VAR.work }} && build {{ VAR.work }}",
395
+
385
396
  // Pull values out of arbitrary JSON without `jq` (works on every shell):
386
397
  "echo db_host={{ json_get(read_file('config.json'), 'database.host') }}",
387
398
 
Binary file
@@ -277,7 +277,7 @@ and work as full substitution bodies *or* as chain segments:
277
277
  // encoding : base64_encode, base64_decode, url_encode, url_decode
278
278
  // hashing : sha256, md5
279
279
  // ids/time : uuid, now
280
- // files : read_file, write_file, file_exists
280
+ // files : read_file, write_file, file_exists, temp_file, temp_dir
281
281
  // json : json_get, json_set
282
282
  // control : try, error
283
283
  // shell : shell_quote, capture
@@ -382,6 +382,17 @@ and work as full substitution bodies *or* as chain segments:
382
382
  // `printf > file`-style redirect on Windows. `--dry-run` skips the write.
383
383
  "{{ write_file('build.gradle.kts', regex_replace(read_file('build.gradle.kts'), 'versionCode = [0-9]+', 'versionCode = 43')) }}",
384
384
 
385
+ // Create a temp file / dir in the OS temp directory, auto-deleted when the
386
+ // CLI exits. `temp_file([content], [extension])` writes `content` (if given)
387
+ // and appends `.<extension>` (leading dot optional); `temp_dir()` makes an
388
+ // empty directory (removed recursively). `--dry-run` → `<temp_file>` /
389
+ // `<temp_dir>` placeholders, nothing created. Capture the path once with
390
+ // `define` and reuse it:
391
+ "{{ define(cfg, temp_file('{\"env\":\"prod\"}', 'json')) }}",
392
+ "tool --config {{ VAR.cfg }}",
393
+ "{{ define(work, temp_dir()) }}",
394
+ "git clone --depth 1 $REPO {{ VAR.work }} && build {{ VAR.work }}",
395
+
385
396
  // Pull values out of arbitrary JSON without `jq` (works on every shell):
386
397
  "echo db_host={{ json_get(read_file('config.json'), 'database.host') }}",
387
398
 
Binary file
@@ -277,7 +277,7 @@ and work as full substitution bodies *or* as chain segments:
277
277
  // encoding : base64_encode, base64_decode, url_encode, url_decode
278
278
  // hashing : sha256, md5
279
279
  // ids/time : uuid, now
280
- // files : read_file, write_file, file_exists
280
+ // files : read_file, write_file, file_exists, temp_file, temp_dir
281
281
  // json : json_get, json_set
282
282
  // control : try, error
283
283
  // shell : shell_quote, capture
@@ -382,6 +382,17 @@ and work as full substitution bodies *or* as chain segments:
382
382
  // `printf > file`-style redirect on Windows. `--dry-run` skips the write.
383
383
  "{{ write_file('build.gradle.kts', regex_replace(read_file('build.gradle.kts'), 'versionCode = [0-9]+', 'versionCode = 43')) }}",
384
384
 
385
+ // Create a temp file / dir in the OS temp directory, auto-deleted when the
386
+ // CLI exits. `temp_file([content], [extension])` writes `content` (if given)
387
+ // and appends `.<extension>` (leading dot optional); `temp_dir()` makes an
388
+ // empty directory (removed recursively). `--dry-run` → `<temp_file>` /
389
+ // `<temp_dir>` placeholders, nothing created. Capture the path once with
390
+ // `define` and reuse it:
391
+ "{{ define(cfg, temp_file('{\"env\":\"prod\"}', 'json')) }}",
392
+ "tool --config {{ VAR.cfg }}",
393
+ "{{ define(work, temp_dir()) }}",
394
+ "git clone --depth 1 $REPO {{ VAR.work }} && build {{ VAR.work }}",
395
+
385
396
  // Pull values out of arbitrary JSON without `jq` (works on every shell):
386
397
  "echo db_host={{ json_get(read_file('config.json'), 'database.host') }}",
387
398
 
Binary file
@@ -277,7 +277,7 @@ and work as full substitution bodies *or* as chain segments:
277
277
  // encoding : base64_encode, base64_decode, url_encode, url_decode
278
278
  // hashing : sha256, md5
279
279
  // ids/time : uuid, now
280
- // files : read_file, write_file, file_exists
280
+ // files : read_file, write_file, file_exists, temp_file, temp_dir
281
281
  // json : json_get, json_set
282
282
  // control : try, error
283
283
  // shell : shell_quote, capture
@@ -382,6 +382,17 @@ and work as full substitution bodies *or* as chain segments:
382
382
  // `printf > file`-style redirect on Windows. `--dry-run` skips the write.
383
383
  "{{ write_file('build.gradle.kts', regex_replace(read_file('build.gradle.kts'), 'versionCode = [0-9]+', 'versionCode = 43')) }}",
384
384
 
385
+ // Create a temp file / dir in the OS temp directory, auto-deleted when the
386
+ // CLI exits. `temp_file([content], [extension])` writes `content` (if given)
387
+ // and appends `.<extension>` (leading dot optional); `temp_dir()` makes an
388
+ // empty directory (removed recursively). `--dry-run` → `<temp_file>` /
389
+ // `<temp_dir>` placeholders, nothing created. Capture the path once with
390
+ // `define` and reuse it:
391
+ "{{ define(cfg, temp_file('{\"env\":\"prod\"}', 'json')) }}",
392
+ "tool --config {{ VAR.cfg }}",
393
+ "{{ define(work, temp_dir()) }}",
394
+ "git clone --depth 1 $REPO {{ VAR.work }} && build {{ VAR.work }}",
395
+
385
396
  // Pull values out of arbitrary JSON without `jq` (works on every shell):
386
397
  "echo db_host={{ json_get(read_file('config.json'), 'database.host') }}",
387
398
 
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.28.0",
3
+ "version": "0.31.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",