Skip to content

Commit 59b9934

Browse files
committed
Adapted to change in exit API. Files moving around.
1 parent e8467b0 commit 59b9934

13 files changed

Lines changed: 189 additions & 74 deletions

File tree

Cargo.lock

Lines changed: 65 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ Available on web at: https://ronilan.github.io/rusticon/
4848
4949
<img src="./gallery/selfie.svg" width="64"><img src="./gallery/selfie-crumbicon.svg" width="64"><img src="./gallery/mondrian.svg" width="64"><img src="./gallery/luffy.svg" width="64"><img src="./gallery/pinky.svg" width="64"><img src="./gallery/lake.svg" width="64"><img src="./gallery/ronilan.svg" width="64"><img src="./gallery/canada.svg" width="64"><img src="./gallery/rust.svg" width="64"><img src="./gallery/1972_BlueMarble.svg" width="64"><img src="./gallery/albert-einstein.svg" width="64">
5050

51+
## Development
52+
53+
See [Development](./markdowns/DEVELOPMENT.md) and [Development Environment Prerequisites](./markdowns/DEVELOPMENT_PREREQUISITES.md)
54+
5155
---
5256

5357
*Fabriqué au Canada : Made in Canada 🇨🇦*

markdowns/DEVELOPMENT.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Development
2+
3+
This project builds and packages for four platforms from a single codebase: **Terminal** (native binary), **Web** (WASM on GitHub Pages), **macOS** (native GUI), and **Windows** (native GUI). Make sure you meet the [development prerequisites](DEVELOPMENT_PREREQUISITES.md) first.
4+
5+
**Build the tools** (from the repo root):
6+
7+
```bash
8+
cargo build-tools
9+
tools/copy.js
10+
```
11+
12+
This builds all three tools (config, package, run) and copies the binaries to the project root.
13+
14+
**Configure the app:**
15+
16+
```bash
17+
./config
18+
```
19+
20+
Sets up the app (name, icon, etc.). Can be re-run at any time to change values. App code lives in `src/` — edit `app.rs` and `platform.rs`.
21+
22+
**Run / develop:**
23+
24+
```bash
25+
./run
26+
```
27+
28+
Launches an interactive menu to build and run for a chosen platform (Terminal, Web/WASM, macOS, or Windows).
29+
30+
**Package & publish:**
31+
32+
```bash
33+
./package
34+
```
35+
36+
Opens the interactive menu to bundle (and optionally publish) the app for your chosen targets.
37+
38+
**Publish with GitHub Actions:**
39+
40+
Two workflows in `.github/workflows/` build and distribute for you on GitHub's servers:
41+
42+
- **Create Downloadable Binaries** — builds the Terminal binary for all four platforms (macOS ARM, macOS Intel, Windows, Linux) plus the macOS and Windows native apps, and attaches them as `.zip` assets to a GitHub Release (or a rolling `latest` tag on manual runs).
43+
- **Deploy to GitHub Pages** — builds the WASM/web version and deploys it as a static site, automatically on every push to `main` (or manually).
44+
45+
> Note: the workflows require an `INCREDIBLE_ALPHA` secret (a GitHub token with read access to the private crate) under Settings > Secrets and variables > Actions.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Development Environment Prerequisites
2+
3+
This document outlines the system requirements and installation steps needed to develop with this template.
4+
5+
## Stack
6+
7+
* Rust
8+
* Cargo
9+
* Incredible
10+
* WebAssembly
11+
* Pnpm
12+
* Vite
13+
* macOS AppKit (via objc2)
14+
* Windows API (via windows-rs)
15+
16+
## macOS
17+
18+
1. **Install Rust** - In Terminal, run the command from [rustup.rs](https://rustup.rs/):
19+
```bash
20+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
21+
```
22+
2. **Install Xcode Command Line Tools**:
23+
```bash
24+
xcode-select --install
25+
```
26+
3. **Enable pnpm**:
27+
```bash
28+
corepack enable
29+
```
30+
4. **Install wasm-pack**:
31+
```bash
32+
cargo install wasm-pack
33+
```
34+
5. **Install librsvg** (for macOS app icon generation):
35+
```bash
36+
brew install librsvg
37+
```
38+
39+
## Windows
40+
41+
1. **Install Rust** - Download and run [rustup-init.exe](https://rustup.rs/) from [rustup.rs](https://rustup.rs/)
42+
2. **Enable pnpm** - Open PowerShell and run:
43+
```powershell
44+
corepack enable
45+
```
46+
3. **Install wasm-pack** - In PowerShell:
47+
```powershell
48+
cargo install wasm-pack
49+
```
50+
4. **Install Visual Studio Build Tools** - Download from [visualstudio.microsoft.com](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022). In the installer, select the **"Desktop development with C++"** workload. This is required to compile the `sharp` native image module and provides the Windows SDK.
File renamed without changes.

markdowns/MARKDOWNS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Markdowns
2+
3+
- [DEVELOPMENT.md](./DEVELOPMENT.md)
4+
- [DEVELOPMENT_PREREQUISITES.md](./DEVELOPMENT_PREREQUISITES.md)
5+
- [From_Crumbicon_to_Rusticon.md](./From_Crumbicon_to_Rusticon.md)

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub fn build() -> App<State> {
6868
el.draw();
6969
}
7070
} else {
71-
exit();
71+
exit(0);
7272
}
7373
return;
7474
}

src/platform/native.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,4 @@ impl RusticonIo for NativeIo {
8282
self.report_message(&err_msg, 196);
8383
}
8484
}
85-
86-
}
85+
}

tools/config/execute.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@ fn replace_field_value(line: &str, key: &str, value: &str) -> String {
66
let leading = &line[..leading_len];
77
let trimmed = line.trim_start();
88
if trimmed.starts_with(key) {
9-
let after_key = trimmed[key.len()..].trim_start();
10-
if after_key.starts_with('=') {
9+
let after_key = &trimmed[key.len()..];
10+
if after_key.trim_start().starts_with('=') {
11+
if let Some(eq_pos) = after_key.find('=') {
12+
let before_eq = &after_key[..eq_pos];
13+
let after_eq = &after_key[eq_pos + 1..];
14+
if let Some(quote_pos) = after_eq.find('"') {
15+
let before_value = &after_eq[..quote_pos];
16+
return format!(
17+
"{}{}{}={}\"{}\"",
18+
leading, key, before_eq, before_value, value
19+
);
20+
}
21+
}
1122
return format!("{}{}= \"{}\"", leading, key, value);
1223
}
1324
}

tools/config/ui/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn build_app() -> App<State> {
1616

1717
app.on_state(|_, state| {
1818
if state.should_apply || state.should_quit {
19-
exit();
19+
exit(0);
2020
}
2121
});
2222

0 commit comments

Comments
 (0)