0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Windows × Makefile × pandoc : openBinaryFile: invalid argument (Invalid argument)

Posted at

Markdown で記載した設計書を納品用に pandoc で PDF 化する案件がありました。
Markdown ファイルは内容に応じて複数に分けて作成しています。
この複数のファイルを PDF 化するコマンドを Makefile に記載していましたが、Makefile をWindows 10 で実行したところ、エラーになりました。

PS C:¥docs> make
pandoc src/*.md --resource-path src --pdf-engine=lualatex -F pandoc-crossref -t pdf -f markdown -o doc.pdf
pandoc: docs/*.md: openBinaryFile: invalid argument (Invalid argument)
make: *** [doc.pdf] Error 1

エラー発生原因は以下の記載にあります。

pandoc src/*.md ...

Unix だと *(アスタリスク)で src/ ディレクトリ以下にある全ての md ファイルを取得してくれるのですが、Windows だとこれが効かない模様。
以下のように wildcard 関数を使うことで、エラーが解消しました。

pandoc $(wildcard src/*.md) ...
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?