From dd567e5be056738792876a513799f720deab9bb7 Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sun, 4 Aug 2024 07:17:45 +0000 Subject: [PATCH] set default HUGO_VERSION value --- README.md | 1 + src/lib.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index f87a6d1..d9c026f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Hugo Plugin +[![fluentci pipeline](https://shield.fluentci.io/x/hugo)](https://pkg.fluentci.io/hugo) [![ci](https://github.com/fluentci-io/hugo-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/fluentci-io/hugo-plugin/actions/workflows/ci.yml) This plugin sets up your CI/CD pipeline with a specific version of [Hugo](https://gohugo.io/). diff --git a/src/lib.rs b/src/lib.rs index 816c0c6..0f528e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,6 +20,12 @@ pub fn setup(version: String) -> FnResult { #[plugin_fn] pub fn build(args: String) -> FnResult { + let version = dag().get_env("HUGO_VERSION")?; + + if version.is_empty() { + dag().set_envs(vec![("HUGO_VERSION".into(), "0.131.0".into())])?; + } + setup_hugo()?; let stdout = dag() .pipeline("build")?