Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heyfoz/rust-cargo-build-trunk-serve
This repository contains shell scripts for macOS/Linux and PowerShell scripts for Windows that automate the process of cloning a Rust project from a private repository, building it using Cargo, compiling with Trunk, and copying the resulting build's unique identifier to the clipboard for easy access.
https://github.com/heyfoz/rust-cargo-build-trunk-serve
automation bash cargo cargo-build powershell rust rust-lang trunk trunk-serve
Last synced: 2 months ago
JSON representation
This repository contains shell scripts for macOS/Linux and PowerShell scripts for Windows that automate the process of cloning a Rust project from a private repository, building it using Cargo, compiling with Trunk, and copying the resulting build's unique identifier to the clipboard for easy access.
- Host: GitHub
- URL: https://github.com/heyfoz/rust-cargo-build-trunk-serve
- Owner: heyfoz
- License: mit
- Created: 2023-11-02T02:07:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-23T05:27:54.000Z (3 months ago)
- Last Synced: 2024-11-23T06:20:26.995Z (3 months ago)
- Topics: automation, bash, cargo, cargo-build, powershell, rust, rust-lang, trunk, trunk-serve
- Language: Shell
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rust Cargo Build Trunk Serve Scripts
A collection of scripts to facilitate using Cargo with Trunk to build and serve Rust projects for local testing.
## Description
This repository contains shell scripts for macOS/Linux and PowerShell scripts for Windows that automate the process of cloning a Rust project from a private repository, building it using Cargo, compiling with Trunk, and copying the resulting build's unique identifier to the clipboard for easy access.
## Getting Started
### Dependencies
- Rust and Cargo must be installed on your system. You can install them from [here](https://www.rust-lang.org/tools/install).
- Trunk must be installed. Instructions can be found [here](https://trunkrs.dev/#installation).
- For macOS/Linux: `xclip` is required for clipboard functionality.
- For Windows: PowerShell is used to run the script.## Common Commands
### Build in Debug Mode and Create WASM Target Dir
```
# sh or PowerShell
cargo build --target=wasm32-unknown-unknown
```### Build in Debug Mode and then Serve if Build is Successful
```bash
# sh
cargo build && trunk serve
``````PowerShell
# PowerShell
cargo build
if ($?) {
trunk serve
}
```### Build in Release Mode and then Serve if Build is Successful
```bash
# sh
cargo build --release && trunk serve --release
``````PowerShell
# PowerShell
cargo build --release
if ($?) {
trunk serve --release
}
```### Installing
- Clone the repository to your local machine:
```bash
git clone https://github.com/heyfoz/rust-cargo-build-trunk-serve.git