1 unstable release
| 0.1.2 | Jun 2, 2023 |
|---|---|
| 0.1.1 |
|
| 0.1.0 |
|
#4 in #forwarded
10KB
66 lines
X-Launcher 🚀
A cross-platform tool-agnostic project automation launcher.
💡 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
xfilestarts with a Unix shebang, then thexfileitself is executed. On Unix-like systems, this is done simply by executing thexfileitself. On Windows,xtakes care of parsing the shebang and executing the correct program with thexfileas 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'sPATHvariable. If the shebang starts with/usr/bin/envthe first argument ofenvis used to lookup the executable. -
If the
xfiledoes not start with a shebang, then it must have the form!commandor>commandwherecommandis 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 thexfile, for>command. In the latter case, the environment variableX_INVOCATION_DIRis 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.
Dependencies
~19KB