Skip to content

Commit

Permalink
set default HUGO_VERSION value
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 4, 2024
1 parent 2337d06 commit dd567e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/).
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ pub fn setup(version: String) -> FnResult<String> {

#[plugin_fn]
pub fn build(args: String) -> FnResult<String> {
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")?
Expand Down

0 comments on commit dd567e5

Please sign in to comment.