From 1da53c300687130b47d653269340ebc87b994f30 Mon Sep 17 00:00:00 2001 From: "Florine W. Dekker" Date: Wed, 16 Mar 2022 09:02:27 +0100 Subject: [PATCH] Document scripts --- deploy-nginx | 7 ++++++- deploy-npm | 7 ++++++- deploy-npm-versioned | 9 ++++++++- deploy-static | 6 +++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/deploy-nginx b/deploy-nginx index a083514..b4fbe66 100755 --- a/deploy-nginx +++ b/deploy-nginx @@ -1,5 +1,10 @@ #!/usr/local/bin/bash -# Usage: deploy-nginx target +# Usage: `deploy-nginx $target` +# +# Copies nginx configuration files from the repository in the current directory to `$target`, and then reloads nginx. +# +# This script is specifically for https://git.fwdekker.com/fwdekker.com/nginx-config. + repo_dir="$(pwd)" repo_name="$(basename -s .git "$repo_dir")" diff --git a/deploy-npm b/deploy-npm index e248cbf..8a4aca3 100755 --- a/deploy-npm +++ b/deploy-npm @@ -1,5 +1,10 @@ #!/usr/local/bin/bash -# Usage: deploy-npm [--delete-target] target +# Usage: `deploy-npm [--delete-target] $target` +# +# Builds the repository in the current directory with `npm run deploy` and copies the contents of `dist/` into +# `$target`. +# If `--delete-target` is set, then `$target` is deleted before copying, except for hidden files and folders. + if [ "$1" == "--delete-target" ]; then delete_target=true diff --git a/deploy-npm-versioned b/deploy-npm-versioned index 8fd0d17..dcdfb58 100755 --- a/deploy-npm-versioned +++ b/deploy-npm-versioned @@ -1,5 +1,12 @@ #!/usr/local/bin/bash -# $1 = destination +# Usage: `deploy-npm-versioned $dst_dir` +# +# Builds the repository in the current directory with `npm run deploy` and copies the contents of `dist/` into multiple +# sub-directories in `$dst_dir`. +# The sub-directories are named after the version number listed in the `package.json`. +# If the version is `A.B.C`, then the repository is deployed into sub-directories `A.B.C`, `A.B.x`, and `A.x.x`, where +# `x` is literal. + repo_dir="$(pwd)" repo_name="$(basename -s .git "$repo_dir")" diff --git a/deploy-static b/deploy-static index cb0b91d..8af9c76 100755 --- a/deploy-static +++ b/deploy-static @@ -1,5 +1,9 @@ #!/usr/local/bin/bash -# Usage: deploy-static [--delete-target] target +# Usage: `deploy-static [--delete-target] $target` +# +# Takes the repository in the current directory, and copies the contents of `dist/` into `$target`. +# If `--delete-target` is set, then `$target` is deleted before copying, except for hidden files and folders. + if [ "$1" == "--delete-target" ]; then delete_target=true