Skip to content

Commit

Permalink
Support slash in layer ID
Browse files Browse the repository at this point in the history
Closes unvt#56
  • Loading branch information
keichan34 committed Dec 1, 2022
1 parent c93c3ac commit 637912a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/yaml-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ const writeDecompositedYaml = (
const layer = style.layers[i]
const layerYml = YAML.dump(layer)
const fileName = `${style.layers[i].id}.yml`
const dirName = path.join(path.dirname(destinationPath), 'layers')
fs.mkdirSync(dirName, { recursive: true })
fs.writeFileSync(path.join(dirName, fileName), layerYml)
const layersDirName = path.join(path.dirname(destinationPath), 'layers')
const filePath = path.join(layersDirName, fileName)
fs.mkdirSync(path.dirname(filePath), { recursive: true })
fs.writeFileSync(filePath, layerYml)
// @ts-ignore
layers.push(`!!inc/file ${path.join('layers', fileName)}`)
}
Expand Down

0 comments on commit 637912a

Please sign in to comment.