From 4e7260ff92a14627d9026371cef1a1abd620cf2c Mon Sep 17 00:00:00 2001 From: Philippe Zwietering Date: Tue, 8 Sep 2026 14:57:18 +0200 Subject: [PATCH] Used internal build tooling to pack index --- Jenkinsfile | 3 +-- build.rs | 9 +++++++++ index.html | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 build.rs diff --git a/Jenkinsfile b/Jenkinsfile index d6b1b71..027fb3f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,8 +8,7 @@ pipeline { } stage('Build') { steps { - sh 'wasm-pack build --target web --out-dir /var/www/zwietering.eu/projects/double-pendulum/pkg' - sh 'cp ./index.html /var/www/zwietering.eu/projects/double-pendulum' + sh 'wasm-pack build --target web --out-dir /var/www/zwietering.eu/projects/double-pendulum/' } } } diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..46e1a2c --- /dev/null +++ b/build.rs @@ -0,0 +1,9 @@ +use std::fs; + +fn main() { + println!("cargo:rerun-if-changed=index.html"); + + if let Err(e) = fs::copy("index.html", "pkg/index.html") { + eprintln!("Error: Couldn't copy index.html: {}", e); + } +} diff --git a/index.html b/index.html index ec34062..181f62b 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@