Skip to content

Commit

Permalink
Merge pull request #22 from h-enk/release-0.2.0
Browse files Browse the repository at this point in the history
Update for 0.2.0
  • Loading branch information
h-enk committed Oct 12, 2020
2 parents 9404e24 + 0ef48ec commit e8b555f
Show file tree
Hide file tree
Showing 5 changed files with 586 additions and 34 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.0] - 2020-10-12

### Added
- create command: remove `/.dependabot`, `/.github`, and `/.travis.yml`
- [update-notifier](https://github.com/yeoman/update-notifier)

### Changed
- version command: output
- create command: after install instructions

## [0.1.1] - 2020-04-28
### Changed
- chalk from `blue` to `cyan`
Expand All @@ -14,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial release

[Unreleased]: https://github.com/h-enk/hyas-cli/compare/v0.1.1...HEAD
[Unreleased]: https://github.com/h-enk/hyas-cli/compare/v0.2.0...HEAD
[0.2.0]: https://github.com/h-enk/hyas-cli/releases/tag/v0.2.0
[0.1.1]: https://github.com/h-enk/hyas-cli/releases/tag/v0.1.1
[0.1.0]: https://github.com/h-enk/hyas-cli/releases/tag/v0.1.0
21 changes: 21 additions & 0 deletions bin/index.js
@@ -1,11 +1,32 @@
#!/usr/bin/env node
const shell = require('shelljs')
const chalk = require('chalk')

const updateNotifier = require('update-notifier')
const pkg = require('../package.json')
const notifier = updateNotifier({
pkg,
// updateCheckInterval: 0,
updateCheckInterval: 1000 * 60 * 60 * 24 * 7, // 1 week
shouldNotifyInNpmScript: true,
});

if (notifier.update) {
const withYarn = shell.which('yarn')
const margin = chalk.bgGreen(' ')
const command = withYarn ? `yarn global add ${pkg.name}` : `npm i -g ${pkg.name}`
console.log()
console.log(`${margin} Update available: ${chalk.bold(notifier.update.latest)}`)
console.log(`${margin} Run ${chalk.cyan(command)} to update`)
console.log()
}

require('yargs')
.usage('Usage: hyas <command> [options]')
.commandDir('../lib/commands')
.scriptName('')
.showHelpOnFail(true)
.version('version', 'Show version number', '@hyas/cli v0.2.0')
.alias('version', 'v')
.alias('help', 'h')
.epilogue('Run ' + chalk.cyan('hyas <command> --help') + ' for detailed usage of given command.')
Expand Down
15 changes: 12 additions & 3 deletions lib/commands/create.js
@@ -1,4 +1,4 @@
var shell = require('shelljs')
const shell = require('shelljs')
const chalk = require('chalk')

exports.command = 'create [dir]'
Expand All @@ -17,6 +17,9 @@ exports.handler = function (argv) {
shell.exit(1)
} else {
shell.exec('rm -rf ' + dir + '/.git')
shell.exec('rm -rf ' + dir + '/.dependabot')
shell.exec('rm -rf ' + dir + '/.github')
shell.exec('rm -rf ' + dir + '/.travis.yml')
shell.cd(dir)

shell.echo('Installing dependencies...')
Expand All @@ -27,7 +30,13 @@ exports.handler = function (argv) {
}

shell.echo('\n - Enter directory ' + chalk.cyan('cd ' + dir))
shell.echo(' - Run ' + chalk.cyan('hyas start') + ' to start local development')
shell.echo(' - Run ' + chalk.cyan('hyas build') + ' to build for production\n')
if (shell.which('yarn')) {
shell.echo(' - Run ' + chalk.cyan('yarn start') + ' to start local development')
shell.echo(' - Run ' + chalk.cyan('yarn build') + ' to build for production\n')
} else {
shell.echo(' - Run ' + chalk.cyan('npm run start') + ' to start local development')
shell.echo(' - Run ' + chalk.cyan('npm run build') + ' to build for production\n')
}

}
}

0 comments on commit e8b555f

Please sign in to comment.