@runfile/cli 0.17.0 → 0.19.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.
@@ -255,7 +255,7 @@ and work as full substitution bodies *or* as chain segments:
255
255
  // validate : one_of
256
256
  // encoding : base64_encode, base64_decode
257
257
  // hashing : sha256, md5
258
- // files : read_file, file_exists
258
+ // files : read_file, write_file, file_exists
259
259
  // json : json_get, json_set
260
260
  // error : try
261
261
  // shell : shell_quote, capture
@@ -320,6 +320,15 @@ and work as full substitution bodies *or* as chain segments:
320
320
  // Use `try(...)` to recover from missing files.
321
321
  "echo version={{ try(read_file('VERSION')) ? '0.0.0-dev' }}",
322
322
 
323
+ // Write a file straight from a substitution — pairs with `read_file` for
324
+ // read-modify-write pipelines (version bumps, config edits, …). Returns
325
+ // an empty string, so a line containing only this call is dropped silently
326
+ // (same convention as `define`). Goes through Rust's `std::fs::write`, so
327
+ // it sidesteps the shell entirely — safe for large content, content with
328
+ // quotes, embedded newlines, anything that would break a
329
+ // `printf > file`-style redirect on Windows. `--dry-run` skips the write.
330
+ "{{ write_file('build.gradle.kts', regex_replace(read_file('build.gradle.kts'), 'versionCode = [0-9]+', 'versionCode = 43')) }}",
331
+
323
332
  // Pull values out of arbitrary JSON without `jq` (works on every shell):
324
333
  "echo db_host={{ json_get(read_file('config.json'), 'database.host') }}",
325
334
 
Binary file
@@ -255,7 +255,7 @@ and work as full substitution bodies *or* as chain segments:
255
255
  // validate : one_of
256
256
  // encoding : base64_encode, base64_decode
257
257
  // hashing : sha256, md5
258
- // files : read_file, file_exists
258
+ // files : read_file, write_file, file_exists
259
259
  // json : json_get, json_set
260
260
  // error : try
261
261
  // shell : shell_quote, capture
@@ -320,6 +320,15 @@ and work as full substitution bodies *or* as chain segments:
320
320
  // Use `try(...)` to recover from missing files.
321
321
  "echo version={{ try(read_file('VERSION')) ? '0.0.0-dev' }}",
322
322
 
323
+ // Write a file straight from a substitution — pairs with `read_file` for
324
+ // read-modify-write pipelines (version bumps, config edits, …). Returns
325
+ // an empty string, so a line containing only this call is dropped silently
326
+ // (same convention as `define`). Goes through Rust's `std::fs::write`, so
327
+ // it sidesteps the shell entirely — safe for large content, content with
328
+ // quotes, embedded newlines, anything that would break a
329
+ // `printf > file`-style redirect on Windows. `--dry-run` skips the write.
330
+ "{{ write_file('build.gradle.kts', regex_replace(read_file('build.gradle.kts'), 'versionCode = [0-9]+', 'versionCode = 43')) }}",
331
+
323
332
  // Pull values out of arbitrary JSON without `jq` (works on every shell):
324
333
  "echo db_host={{ json_get(read_file('config.json'), 'database.host') }}",
325
334
 
Binary file
@@ -255,7 +255,7 @@ and work as full substitution bodies *or* as chain segments:
255
255
  // validate : one_of
256
256
  // encoding : base64_encode, base64_decode
257
257
  // hashing : sha256, md5
258
- // files : read_file, file_exists
258
+ // files : read_file, write_file, file_exists
259
259
  // json : json_get, json_set
260
260
  // error : try
261
261
  // shell : shell_quote, capture
@@ -320,6 +320,15 @@ and work as full substitution bodies *or* as chain segments:
320
320
  // Use `try(...)` to recover from missing files.
321
321
  "echo version={{ try(read_file('VERSION')) ? '0.0.0-dev' }}",
322
322
 
323
+ // Write a file straight from a substitution — pairs with `read_file` for
324
+ // read-modify-write pipelines (version bumps, config edits, …). Returns
325
+ // an empty string, so a line containing only this call is dropped silently
326
+ // (same convention as `define`). Goes through Rust's `std::fs::write`, so
327
+ // it sidesteps the shell entirely — safe for large content, content with
328
+ // quotes, embedded newlines, anything that would break a
329
+ // `printf > file`-style redirect on Windows. `--dry-run` skips the write.
330
+ "{{ write_file('build.gradle.kts', regex_replace(read_file('build.gradle.kts'), 'versionCode = [0-9]+', 'versionCode = 43')) }}",
331
+
323
332
  // Pull values out of arbitrary JSON without `jq` (works on every shell):
324
333
  "echo db_host={{ json_get(read_file('config.json'), 'database.host') }}",
325
334
 
Binary file
@@ -255,7 +255,7 @@ and work as full substitution bodies *or* as chain segments:
255
255
  // validate : one_of
256
256
  // encoding : base64_encode, base64_decode
257
257
  // hashing : sha256, md5
258
- // files : read_file, file_exists
258
+ // files : read_file, write_file, file_exists
259
259
  // json : json_get, json_set
260
260
  // error : try
261
261
  // shell : shell_quote, capture
@@ -320,6 +320,15 @@ and work as full substitution bodies *or* as chain segments:
320
320
  // Use `try(...)` to recover from missing files.
321
321
  "echo version={{ try(read_file('VERSION')) ? '0.0.0-dev' }}",
322
322
 
323
+ // Write a file straight from a substitution — pairs with `read_file` for
324
+ // read-modify-write pipelines (version bumps, config edits, …). Returns
325
+ // an empty string, so a line containing only this call is dropped silently
326
+ // (same convention as `define`). Goes through Rust's `std::fs::write`, so
327
+ // it sidesteps the shell entirely — safe for large content, content with
328
+ // quotes, embedded newlines, anything that would break a
329
+ // `printf > file`-style redirect on Windows. `--dry-run` skips the write.
330
+ "{{ write_file('build.gradle.kts', regex_replace(read_file('build.gradle.kts'), 'versionCode = [0-9]+', 'versionCode = 43')) }}",
331
+
323
332
  // Pull values out of arbitrary JSON without `jq` (works on every shell):
324
333
  "echo db_host={{ json_get(read_file('config.json'), 'database.host') }}",
325
334
 
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.17.0",
3
+ "version": "0.19.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",