Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Commit

Permalink
Fix problem with paths containing spaces (fixes #5 and #7)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjo committed May 8, 2014
1 parent 490af68 commit bc5cdea
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/latexmk.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ module.exports =
if outdir?.length
dir = path.dirname(filePath)
outdir = path.join(dir, outdir)
args.push("-outdir=#{outdir}")
args.push("-outdir=\"#{outdir}\"")

args.push(filePath)
args.push("\"#{filePath}\"")
args

constructPath: ->
Expand Down
6 changes: 6 additions & 0 deletions spec/fixtures/filename with spaces.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
\documentclass{article}

\begin{document}
\section{\LaTeX}
Lorem ipsum dolor sit amet...
\end{document}
4 changes: 0 additions & 4 deletions spec/fixtures/latexmk

This file was deleted.

14 changes: 13 additions & 1 deletion spec/latex-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ describe "Latex", ->
atom.workspace = atom.workspaceView.model

# Ensure package has sensible config values
atom.config.set("latex.texPath", "#{fixturesPath}:$PATH")
atom.config.set("latex.texPath", "$PATH:/usr/texbin")
atom.config.set("latex.outputDirectory", "output")
atom.config.set("latex.enableShellEscape", false)

describe "build", ->
it "does nothing for new, unsaved files", ->
Expand Down Expand Up @@ -50,3 +51,14 @@ describe "Latex", ->
latex.build()

expect(editor.isModified()).toEqual(false)


it "supports paths containing spaces", ->
editor = atom.workspaceView.openSync("filename with spaces.tex")
[exitCode, done] = []

spyOn(latex, "showResult").andCallFake -> done = true
latex.build()

waitsFor -> done
runs -> expect(latex.showResult).toHaveBeenCalled();

0 comments on commit bc5cdea

Please sign in to comment.