diff --git a/engine/build.sh b/engine/build.sh index c972ea8..55427ef 100755 --- a/engine/build.sh +++ b/engine/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 echo "* org-publish" emacs \ --load project.el \ diff --git a/engine/clean.sh b/engine/clean.sh index 93d5c5b..1c7fcb3 100755 --- a/engine/clean.sh +++ b/engine/clean.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 echo -n "* Clean site cache" rm -rf _site rm -rf _cache diff --git a/engine/compresscss.sh b/engine/compresscss.sh index 24ed64d..763a779 100755 --- a/engine/compresscss.sh +++ b/engine/compresscss.sh @@ -1,8 +1,8 @@ #!/usr/bin/env nix-shell -#!nix-shell -i zsh +#!nix-shell -i bash #!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" #!nix-shell -p minify # nix-shell -p nodePackages.clean-css -minify $1 > $2 +minify "$1" > "$2" diff --git a/engine/deploy.sh b/engine/deploy.sh index 6610eb4..5f2b727 100755 --- a/engine/deploy.sh +++ b/engine/deploy.sh @@ -1,8 +1,8 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 rootdir=${0:h} -echo $rootdir +echo "$rootdir" ./engine/clean.sh ./engine/build.sh diff --git a/engine/dup-for-themes.sh b/engine/dup-for-themes.sh index f82e968..ae10842 100755 --- a/engine/dup-for-themes.sh +++ b/engine/dup-for-themes.sh @@ -2,12 +2,12 @@ #!nix-shell -i zsh #!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 webdir="_site" debug () { - print -- $* >/dev/null + print -- "$@" >/dev/null } if (($#>0)); then @@ -24,7 +24,7 @@ trans(){ print -- "Duplicate HTML by themes" for fic in $filelist; do - if echo $fic|egrep -- '-(mk|min|sci|modern).html$'>/dev/null; then + if echo $fic|grep -E -- '-(mk|min|sci|modern).html$'>/dev/null; then continue fi print -n -- "$fic " diff --git a/engine/mkrss.sh b/engine/mkrss.sh index 7ef49b0..7cf127a 100755 --- a/engine/mkrss.sh +++ b/engine/mkrss.sh @@ -2,7 +2,7 @@ #!nix-shell -i zsh #!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 # Directory webdir="_site" postsdir="$webdir/posts" diff --git a/engine/optim-classes.sh b/engine/optim-classes.sh index 1890b3a..9226cf4 100755 --- a/engine/optim-classes.sh +++ b/engine/optim-classes.sh @@ -2,7 +2,7 @@ #!nix-shell -i zsh #!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 webdir="_site" retrieve_classes_in_html () { diff --git a/engine/optim-html.sh b/engine/optim-html.sh index 2cf608d..37dcd22 100755 --- a/engine/optim-html.sh +++ b/engine/optim-html.sh @@ -2,7 +2,7 @@ #!nix-shell -i zsh #!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 webdir="_site" debug () { diff --git a/engine/pre-deploy.sh b/engine/pre-deploy.sh index 3e3969c..fce54e9 100755 --- a/engine/pre-deploy.sh +++ b/engine/pre-deploy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 echo "Optim HTML size" ./engine/optim-html.sh echo "Gen themes clones" diff --git a/engine/serve.sh b/engine/serve.sh index 9699415..0696921 100755 --- a/engine/serve.sh +++ b/engine/serve.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 cd _site && sws -d --port 3001 . diff --git a/engine/sign-project.sh b/engine/sign-project.sh index be7debf..cee23bd 100755 --- a/engine/sign-project.sh +++ b/engine/sign-project.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 signer=yann@esposito.host gpg --local-user $signer --output project.el.sig --detach-sign project.el diff --git a/engine/sync.sh b/engine/sync.sh index 55f331f..5c60273 100755 --- a/engine/sync.sh +++ b/engine/sync.sh @@ -1,6 +1,6 @@ #!/usr/bin/env zsh -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 rootdir=${0:h} echo $rootdir diff --git a/engine/update-file-size.sh b/engine/update-file-size.sh index a2a954c..a2058ab 100755 --- a/engine/update-file-size.sh +++ b/engine/update-file-size.sh @@ -2,7 +2,7 @@ #!nix-shell -i zsh #!nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/19.09.tar.gz" -cd $(git rev-parse --show-toplevel) +cd "$(git rev-parse --show-toplevel)" || exit 1 webdir="_site" sizeof() {