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 @@