3 Commits

Author SHA1 Message Date
Shiewk 40b9267bbf release: 1.0.1
Test and release / Run Tests (push) Successful in 2m55s
Test and release / Build and Release (push) Successful in 4m30s
2026-04-19 18:41:34 +02:00
Shiewk d771e6fc48 fix: check for file presence after download
Test and release / Run Tests (push) Has been cancelled
Test and release / Build and Release (push) Has been cancelled
2026-04-19 18:41:11 +02:00
Shiewk c4b3f1fe3f docs: add description, usage, and configuration to readme
Test and release / Run Tests (push) Successful in 2m55s
Test and release / Build and Release (push) Has been skipped
2026-04-19 18:35:18 +02:00
3 changed files with 40 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "shy-launcher" name = "shy-launcher"
version = "1.0.0" version = "1.0.1"
edition = "2024" edition = "2024"
[profile.release] [profile.release]
+29 -1
View File
@@ -1,2 +1,30 @@
# shy-launcher # shy-launcher
Utility for launching apps for Linux.
**shy-launcher** is an utility for downloading assets and launching applications on Linux.
## What can it do?
It can:
- Download assets over HTTP/S before the program starts
- Verify that you have the latest version of your files/program/plugins
- Change permissions for executable downloads
## Configuration
Below is an example `config.json`; adapt it to your needs:
```json
{
"name": "My Java server",
"run": "java",
"args": ["-jar", "server.jar"],
"downloads": [{
"method": "GET",
"url": "https://some.asset.server.shiewk.de/coolserver/latest/server.jar",
"headers": {
"Authorization": "Bearer tOk3n"
},
"filename": "server.jar",
"permissions": 700
}]
}
```
+10 -1
View File
@@ -1,4 +1,4 @@
use std::{error::Error, process::Command}; use std::{error::Error, fs, process::Command};
use shy_launcher::{config::Config, downloader}; use shy_launcher::{config::Config, downloader};
@@ -10,6 +10,15 @@ async fn main() -> Result<(), Box<dyn Error>> {
println!("Starting download..."); println!("Starting download...");
downloader::download(config.downloads()).await; downloader::download(config.downloads()).await;
println!("Verifying file presence...");
for download in config.downloads() {
let filename = download.filename();
if !fs::exists(filename)? {
panic!("Required file {} not present", filename);
}
println!("[ok] {}", filename);
}
println!("Freeing memory..."); println!("Freeing memory...");
if unsafe { libc::malloc_trim(0) } == 1 { if unsafe { libc::malloc_trim(0) } == 1 {
println!("Freed up some memory."); println!("Freed up some memory.");