x-launcher

Crates.iox-launcher
lib.rsx-launcher
version0.1.2
sourcesrc
created_at2023-06-02 09:58:06.207608
updated_at2023-06-02 10:18:26.039795
descriptionA cross-platform tool-agnostic project automation launcher.
homepage
repository
max_upload_size
id880724
size23,350
Maximilian Köhl (koehlma)

documentation

README

X-Launcher 🚀

A cross-platform tool-agnostic project automation launcher.

License: MIT OR Apache 2.0 X-Launcher Rust Crate

💡 TL;DR: X-Launcher is a simple binary x which, when executed, scans for an xfile starting in the invocation directory and working its way up. When it finds an xfile, it uses it to launch project-specific tooling either (a) by executing the xfile itself or (b) delegating to a third-party tool (e.g., cargo, make, or npm).

🤔 Rationale: X-Launcher provides consistency across projects using different tools and languages by making x the universal command to interact with whatever tooling is required to work on a project. In addition, it makes it very easy to add custom freeform tooling in the form of an xfile script (e.g., Bash or Python).

Checkout the examples to get an idea what X-Launcher can do for you. X-Launcher is designed to work with any tool. Just to name a few examples, X-Launcher works well with Cargo, npm, make, just, and Poetry.

Installation

Currently, the official way to install X-Launcher is via Cargo:

cargo install x-launcher

Usage

Simply run x. All arguments are forwarded to the underlying tool.

xfile Reference

An xfile is interpreted in one of two ways:

  • If the xfile starts with a Unix shebang, then the xfile itself is executed. On Unix-like systems, this is done simply by executing the xfile itself. On Windows, x takes care of parsing the shebang and executing the correct program with the xfile as an argument. To this end, if the shebang starts with a path, other than /usr/bin/env, the binary name is looked up using the environment's PATH variable. If the shebang starts with /usr/bin/env the first argument of env is used to lookup the executable.

  • If the xfile does not start with a shebang, then it must have the form !command or >command where command is interpreted as a POSIX shell command (currently without performing any expansions, e.g., of variables or ~). X-Launcher will execute the specified command in the invocation directory, for !command, or in the directory of the xfile, for >command. In the latter case, the environment variable X_INVOCATION_DIR is set to the invocation directory such that it can still be retrieved.

In any case, arguments passed to x are forwarded to whatever is launched.

Contributing

We do accept bug fixes and improvements, and are open to discuss ideas. However, note that X-Launcher is intentionally kept very simple. There are already many great tools out there solving different project automation needs. X-Launcher is, as the name suggests, just a launcher and does not aim be more. Hence, we will likely reject any contributions extending X-Launcher beyond the purpose of launching.

Licensing

X-Launcher is licensed under either MIT or Apache 2.0 at your opinion. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache 2.0 license, shall be dual licensed as above, without any additional terms or conditions.


Made with ❤️ for OSS by Silitics.

Commit count: 0

cargo fmt