Add build command argument
This commit is contained in:
parent
d3f2d25a0f
commit
a589bcb799
4 changed files with 13 additions and 2 deletions
|
@ -33,6 +33,8 @@ struct Arguments {
|
|||
pub prefix: String,
|
||||
#[clap(long, help = "Path to Hugo project where site rebuilds")]
|
||||
pub hugo: String,
|
||||
#[clap(long, help = "Build command", default_value = "hugo")]
|
||||
pub build: String,
|
||||
#[clap(long = "guilds", help = "Path to guild data JSON file", default_value = "guilds.json")]
|
||||
pub guild_data: String,
|
||||
}
|
||||
|
@ -44,6 +46,7 @@ impl Arguments {
|
|||
discord_token: env::var("DISCORD_TOKEN")?,
|
||||
prefix: env::var("PREFIX")?,
|
||||
hugo: env::var("HUGO")?.into(),
|
||||
build: env::var("BUILD")?,
|
||||
guild_data: env::var("GUILD_DATA")?.into(),
|
||||
})
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ pub fn to_fullwidth(string: &str) -> String {
|
|||
}
|
||||
|
||||
pub fn rebuild_site() {
|
||||
Command::new("./build.sh")
|
||||
Command::new(&ARGS.build)
|
||||
.current_dir(&ARGS.hugo)
|
||||
.status()
|
||||
.expect("Failed to rebuild site");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue