Skip to content

Commit

Permalink
Use basename for whats-that-gerber
Browse files Browse the repository at this point in the history
  • Loading branch information
kasbah committed Sep 12, 2018
1 parent 757d7f9 commit ac16fe0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gerber_files.js
Expand Up @@ -7,7 +7,7 @@ function gerberFiles(files, gerberPath) {
files = files.filter(f => regex.test(f))
}
const layers = files
.map(f => ({path: f, type: whatsThatGerber(f)}))
.map(f => ({path: f, type: whatsThatGerber(path.basename(f))}))
.filter(({type}) => type !== 'drw')
const possibleGerbers = layers.map(({path}) => path)
const possibleTypes = layers.map(({type}) => type)
Expand Down
2 changes: 1 addition & 1 deletion src/submit/url_submit.jsx
Expand Up @@ -225,7 +225,7 @@ const UrlSubmit = React.createClass({
return superagent
.get(url.resolve(GIT_CLONE_SERVER, path.join(root, f)))
.withCredentials()
.then(res => ({gerber: res.text, filename: f}))
.then(res => ({gerber: res.text, filename: path.basename(f)}))
})
Promise.all(requests).then(buildBoard.bind(null, dispatch))
dispatch({type: 'setFileListing', value: files})
Expand Down
2 changes: 1 addition & 1 deletion tasks/page/processGerbers.js
Expand Up @@ -79,7 +79,7 @@ if (require.main !== module) {
const stackupData = []
for (let gerberPath of gerbers) {
data = fs.readFileSync(gerberPath, {encoding: 'utf8'})
stackupData.push({filename: gerberPath, gerber: data})
stackupData.push({filename: path.basename(gerberPath), gerber: data})
zip.file(path.join(folder_name, path.basename(gerberPath)), data)
}
zip
Expand Down

0 comments on commit ac16fe0

Please sign in to comment.