rnx-kit/packages/tools-shell
React Native SDK Bot 719257d1b8
RELEASING: Releasing 2 package(s) (#3408)
2024-10-28 17:05:38 +01:00
..
src fix(align-deps): add profile for 0.76 (#3391) 2024-10-28 16:21:34 +01:00
test test: migrate more tests to Node test runner (#3252) 2024-07-30 18:45:19 +02:00
CHANGELOG.md RELEASING: Releasing 2 package(s) (#3408) 2024-10-28 17:05:38 +01:00
README.md fix(align-deps): add profile for 0.76 (#3391) 2024-10-28 16:21:34 +01:00
eslint.config.js feat(tools-shell): introduce new package for shell scripts (#3107) 2024-04-25 14:43:30 +02:00
package.json RELEASING: Releasing 2 package(s) (#3408) 2024-10-28 17:05:38 +01:00
tsconfig.json feat(tools-shell): introduce new package for shell scripts (#3107) 2024-04-25 14:43:30 +02:00

README.md

@rnx-kit/tools-shell

Build npm version

@rnx-kit/tools-shell is a collection of functions for writing shell scripts.

You can import the entire package, or, to save space, import individual categories:

import * as tools from "@rnx-kit/tools-shell";

// Alternatively...
import * as asyncTools from "@rnx-kit/tools-shell/async";
import * as commandTools from "@rnx-kit/tools-shell/command";
Category Function Description
async idle(ms) Sleep for a specified numer of milliseconds.
async once(func) Wraps the function, making sure it only gets called once.
async retry(func, retries, counter) Calls the specified function, retrying up to specified number of times as long as the result is null.
async withRetry(func, retries, counter) Calls the specified function, retrying up to specified number of times as long as the function throws.
command ensure(result, message) Throws if the result of the process is non-zero.
command ensureInstalled(check, message) Throws if the provided command fails.
command makeCommand(command, userOptions) Creates an async function for calling the specified command.
command makeCommandSync(command) Creates a synchronous function for calling the specified command.
untar untar(archive) Invokes tar xf.