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

Commit

Permalink
fix: use dotfile manifest when set like that in files
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 4, 2018
1 parent 90d1e74 commit 75aa0f5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/commands/manifest.ts
Expand Up @@ -29,14 +29,9 @@ export default class Manifest extends Command {
if (process.env.OCLIF_NEXT_VERSION) {
plugin.manifest.version = process.env.OCLIF_NEXT_VERSION
}
const file = path.join(plugin.root, 'oclif.manifest.json')
const dotfile = plugin.pjson.files.find((f: string) => f.endsWith('.oclif.manifest.json'))
const file = path.join(plugin.root, `${dotfile ? '.' : ''}oclif.manifest.json`)
fs.writeFileSync(file, JSON.stringify(plugin.manifest))
if (plugin.pjson.files.find((f: string) => f.endsWith('.oclif.manifest.json'))) {
const pjsonPath = path.join(plugin.root, 'package.json')
const pjson = await fs.readJSON(pjsonPath)
pjson.files = pjson.files.map((f: string) => f.replace(/\.oclif\.manifest\.json$/, 'oclif.manifest.json'))
await fs.outputJSON(pjsonPath, pjson, {spaces: 2})
}
this.log(`wrote manifest to ${file}`)
}
}

0 comments on commit 75aa0f5

Please sign in to comment.