Add rebuild site command and make site rebuilding using shell script
This commit is contained in:
parent
4f545e6d14
commit
eb43f48b84
2 changed files with 11 additions and 1 deletions
|
@ -107,12 +107,21 @@ fn to_fullwidth(string: &str) -> String {
|
|||
}
|
||||
|
||||
fn rebuild_site() {
|
||||
Command::new("hugo")
|
||||
Command::new("./build.sh")
|
||||
.current_dir(get_hugo_path())
|
||||
.spawn()
|
||||
.expect("Failed to rebuild site");
|
||||
}
|
||||
|
||||
#[command]
|
||||
#[owners_only]
|
||||
#[allow(non_snake_case)]
|
||||
async fn rebuildSite(ctx: &Context, msg: &Message) -> CommandResult {
|
||||
rebuild_site();
|
||||
msg.reply(&ctx.http, "Started site rebuild process!").await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
async fn challenge(ctx: &Context, msg: &Message) -> CommandResult {
|
||||
msg.reply(
|
||||
|
|
|
@ -50,6 +50,7 @@ impl EventHandler for Handler {
|
|||
jlpt,
|
||||
hyogai,
|
||||
so,
|
||||
rebuildSite,
|
||||
challenge,
|
||||
submit,
|
||||
images,
|
||||
|
|
Loading…
Add table
Reference in a new issue