Просмотр исходного кода

Merge pull request #460 from gardouille/fix-just-pandoc-command

Direct use of sed|awk commands
Christina Sørensen 2 лет назад
Родитель
Сommit
89e6ab158c
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      Justfile

+ 2 - 2
Justfile

@@ -74,9 +74,9 @@ all-release: build-release test-release
 # build the man pages
 @man:
     mkdir -p "${CARGO_TARGET_DIR:-target}/man"
-    version=$(cat Cargo.toml | grep ^version | head -n 1 | awk '{print $NF}' | tr -d '"'); \
+    version=$(awk 'BEGIN { FS = "\"" } ; /^version/ { print $2 ; exit }' Cargo.toml); \
     for page in eza.1 eza_colors.5 eza_colors-explanation.5; do \
-        pandoc --standalone -f markdown -t man <(cat "man/${page}.md" | sed "s/\$version/v${version}/g") > "${CARGO_TARGET_DIR:-target}/man/${page}"; \
+        sed "s/\$version/v${version}/g" "man/${page}.md" | pandoc --standalone -f markdown -t man > "${CARGO_TARGET_DIR:-target}/man/${page}"; \
     done;
 
 # build and preview the main man page (eza.1)