Skip to content

Commit

Permalink
scripts/process-markdown: Fix usage of readlink
Browse files Browse the repository at this point in the history
Had used 'readlink -f' to canonicalize input and output paths.
However, this fails when the output directory does not exist yet.

Now uses 'readlink -m' instead to avoid this problem.
  • Loading branch information
lukego committed Mar 20, 2016
1 parent 64ee8af commit 19ffe84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/process-markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# output markdown.

set -e
if [ $# != 2 ]; then
if [ $# != 2 ]; then
echo "Usage: $0 <input> <output>" >&2
exit 1
fi

input=$(readlink -f $1)
output=$(readlink -f $2)
input=$(readlink -m $1)
output=$(readlink -m $2)

[ -d $(dirname "$output") ] || mkdir -p "$(dirname $output)"
cd $(dirname $output)
Expand Down

0 comments on commit 19ffe84

Please sign in to comment.