From ad5d10979d7953ae50e231be50b65b62aa39316c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega=20Froysa?= Date: Mon, 7 Nov 2022 20:26:23 +0100 Subject: [PATCH] Add serve command. --- README.md | 5 +++-- isidore.sh | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab6634f..baacd41 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,10 @@ Synopsis: `isidore [options]` Commands: -- `new `: create a new project directory `` with project name - ``. +- `new [-i] `: create a new project directory ``. Use `-i` for + interactive mode. - `build`: build the website (default). +- `serve`, `server`: run an HTTP server of the output on port 8080. - `clean`: cleans build files. - `help`: show help information. - `version`: show Isidore version number. diff --git a/isidore.sh b/isidore.sh index 950e349..b23f5e2 100755 --- a/isidore.sh +++ b/isidore.sh @@ -90,6 +90,8 @@ function print_help() Create a new Isidore project (use interactive mode with '-i') build Build the project rooted in the current directory + serve | server + Serve a local HTTP server of the output directory on port 8080 clean Clean the built files version @@ -219,6 +221,8 @@ case $1 in new_project $NEW_DIR $INTERACTIVE;; build) build_project;; + serve|server) + php -S localhost:8080 -t ./output/;; clean) clean_project;; help)