Skip to content

Commit

Permalink
Make CSS urls safe for windows (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rik Smith-Unna committed May 5, 2017
1 parent 215d16d commit bc9a43c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/client/lib/imgpath.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const path = require('path')
const win = require('os').platform() === 'win32'

const imgdir = path.join(__dirname, '..', 'images')

module.exports = img => path.join(imgdir, img)
makesage = str => win ? str.replace('\\', '\\\\') : str

module.exports = img => makesafe(path.join(imgdir, img))

0 comments on commit bc9a43c

Please sign in to comment.