diff options
| Commit | 67a6a6a96db43a15bfdf27166cdad678c78ba38f (patch) | |
|---|---|---|
| Author | 2024-07-22 16:17:29 +0300 | |
| Committer | 2024-07-22 16:17:29 +0300 | |
| Files | af2e40f1feb57a996a0ac696001966c07e4c9d9a | |
| csg-67a6a6a96db43a15bfdf27166cdad678c78ba38f.tar csg-67a6a6a96db43a15bfdf27166cdad678c78ba38f.tar.gz csg-67a6a6a96db43a15bfdf27166cdad678c78ba38f.zip | ||
| Parent | bf13dac3035d59bb9463b924a4efbef32b549f27 (diff) | |
(csg) Moved user.begin.awk and added an appropriate option
2 files changed, 10 insertions, 4 deletions
| -rwxr-xr-x | csg | 14 | ||||
| -rw-r--r-- | demo/user.begin.awk (renamed from user.begin.awk) | 0 |
@@ -61,6 +61,10 @@ URL="$4" [ -z "$URL" ] && echo "[Error] <base_url> cannot be an empty string!" \ && csg_help 3 +USERAWKDIR="$5" +[ -n "$USERAWKDIR" -a ! -d "$USERAWKDIR" ] && echo "[Error] $USERAWKDIR (<scripts_dir>) isn't a directory or doesn't exist!" \ + && csg_help 1 + ### Preprocessing 3 ### "Global" variables @@ -101,15 +105,16 @@ EOF ### Stage 2 ### Meta -echo 'BEGIN { FILENAME=ARGV[1];FIRST="f";ALL="a"' > meta.begin.awk +# Includes stuff which will be used in user.begin.awk +echo 'BEGIN { FILENAME=ARGV[1];FIRST="f";ALL="a"' > "$CSG_TMP_DIR/meta.begin.awk" while read -r file do - $CSG_AWK -f meta.awk "$file" >> meta.begin.awk & + $CSG_AWK -f meta.awk "$file" >> "$CSG_TMP_DIR/meta.begin.awk" & done << EOF $(find "$DESTINATION" -type f -name "*.md") EOF wait -echo '}' >> meta.begin.awk +echo '}' >> "$CSG_TMP_DIR/meta.begin.awk" ### Stage 3 ### Convertion @@ -119,7 +124,8 @@ convert_file() { local outf="${file%md}html" $CSG_AWK \ - -f meta.begin.awk -f lib_stack.awk -f user.begin.awk -f single.awk \ + -f "$CSG_TMP_DIR/meta.begin.awk" -f "$USERAWKDIR/user.begin.awk" \ + -f lib_stack.awk -f single.awk \ "$file" > "$outf" rm "$file" } diff --git a/user.begin.awk b/demo/user.begin.awk index c2f31a0..c2f31a0 100644 --- a/user.begin.awk +++ b/demo/user.begin.awk |
