Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 4 insertions, 2 deletions
-rwxr-xr-xcsg6
diff --git a/csg b/csg
index 2a0e452..9321292 100755
--- a/csg
+++ b/csg
@@ -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"
}