diff options
| Commit | 6e188687a433c6945f9e4136baf5c7b6a6816401 (patch) | |
|---|---|---|
| Author | 2024-07-22 16:24:59 +0300 | |
| Committer | 2024-07-22 16:24:59 +0300 | |
| Files | 2f0b0002d64cf182f087961b13cb4287f3a3e9f0 | |
| csg-6e188687a433c6945f9e4136baf5c7b6a6816401.tar csg-6e188687a433c6945f9e4136baf5c7b6a6816401.tar.gz csg-6e188687a433c6945f9e4136baf5c7b6a6816401.zip | ||
| Parent | 67a6a6a96db43a15bfdf27166cdad678c78ba38f (diff) | |
(csg) Allowed csg to be ran from other directories
1 files changed, 4 insertions, 2 deletions
| -rwxr-xr-x | csg | 6 |
@@ -68,6 +68,8 @@ USERAWKDIR="$5" ### Preprocessing 3 ### "Global" variables +CSG_DIR="$(dirname "$0")" + : ${CSG_TMP_DIR:='/tmp'} [ ! -d "$CSG_TMP_DIR" ] && echo "[Error] $CSG_TMP_DIR (\$CSG_TMP_DIR) doesn't exist!" \ && csg_help 1 @@ -109,7 +111,7 @@ EOF 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" >> "$CSG_TMP_DIR/meta.begin.awk" & + $CSG_AWK -f "$CSG_DIR/meta.awk" "$file" >> "$CSG_TMP_DIR/meta.begin.awk" & done << EOF $(find "$DESTINATION" -type f -name "*.md") EOF @@ -125,7 +127,7 @@ convert_file() { $CSG_AWK \ -f "$CSG_TMP_DIR/meta.begin.awk" -f "$USERAWKDIR/user.begin.awk" \ - -f lib_stack.awk -f single.awk \ + -f "$CSG_DIR/lib_stack.awk" -f "$CSG_DIR/single.awk" \ "$file" > "$outf" rm "$file" } |
