How to use @gitmoji-changelog/markdown - 3 common examples

To help you get started, we’ve selected a few @gitmoji-changelog/markdown examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frinyvonnick / gitmoji-changelog / packages / gitmoji-changelog-cli / src / cli.js View on Github external
}
      default: {
        const lastVersion = await getLatestVersion(options.output)
        const newOptions = set(options, 'meta.lastVersion', lastVersion)

        // Handle the case where changelog file exist but there isn't a previous version
        if (options.mode === 'update' && !lastVersion) {
          newOptions.mode = 'init'

          fs.unlinkSync(options.output)
        }

        const changelog = await getChangelog(newOptions, projectInfo)

        logMetaData(changelog)
        await buildMarkdownFile(changelog, newOptions)
      }
    }
    logger.success(`changelog updated into ${options.output}`)
  } catch (e) {
    logger.error(e)
  }

  // force quit (if the latest version request is pending, we don't wait for it)
  return process.exit(0)
}
github frinyvonnick / gitmoji-changelog / packages / gitmoji-changelog-cli / src / cli.js View on Github external
logger.warn('Feel free to open issues or PR into gitmoji-changelog')
    logger.warn('\t> https://github.com/frinyvonnick/gitmoji-changelog')
  }

  try {
    switch (options.format) {
      case 'json': {
        const changelog = await getChangelog(options, projectInfo)

        logMetaData(changelog)

        fs.writeFileSync(options.output, JSON.stringify(changelog))
        break
      }
      default: {
        const lastVersion = await getLatestVersion(options.output)
        const newOptions = set(options, 'meta.lastVersion', lastVersion)

        // Handle the case where changelog file exist but there isn't a previous version
        if (options.mode === 'update' && !lastVersion) {
          newOptions.mode = 'init'

          fs.unlinkSync(options.output)
        }

        const changelog = await getChangelog(newOptions, projectInfo)

        logMetaData(changelog)
        await buildMarkdownFile(changelog, newOptions)
      }
    }
    logger.success(`changelog updated into ${options.output}`)
github frinyvonnick / gitmoji-changelog / packages / gitmoji-changelog-cli / dist / index.js View on Github external
async function main() {
  try {
    const changes = await (0, _core.changelog)();
    _fs2.default.writeFileSync('./CHANGELOG.md', (0, _markdown.convert)(changes));
  } catch (e) {
    console.error('Cannot find a git repository in current path.');
  }
}

@gitmoji-changelog/markdown

Gitmoji Changelog markdown formatter

MIT
Latest version published 3 years ago

Package Health Score

60 / 100
Full package analysis

Similar packages