Skip to content

Commit

Permalink
feat(cli-messages): added some output to outline the steps
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Aug 21, 2019
1 parent 0e73b37 commit 52cc753
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
32 changes: 22 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"travis-lint": "^1.0.0"
},
"dependencies": {
"@travi/cli-messages": "^1.0.1",
"execa": "^2.0.4"
}
}
3 changes: 3 additions & 0 deletions src/gems.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import {resolve} from 'path';
import {info} from '@travi/cli-messages';
import {copyFile} from '../thirdparty-wrappers/fs';
import execa from '../thirdparty-wrappers/execa';

export default async function (projectRoot) {
info('Configuring gem dependencies');

await copyFile(resolve(__dirname, '..', 'templates', 'Gemfile.rb'), `${projectRoot}/Gemfile`);

await execa('bundle', ['install']);
Expand Down
3 changes: 3 additions & 0 deletions src/rake.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {resolve} from 'path';
import {info} from '@travi/cli-messages';
import {copyFile} from '../thirdparty-wrappers/fs';

export default async function (projectRoot) {
info('Configuring Rake');

await copyFile(resolve(__dirname, '..', 'templates', 'Rakefile.rb'), `${projectRoot}/Rakefile`);

return {gems: ['rake']};
Expand Down
5 changes: 5 additions & 0 deletions src/ruby-version.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import {promises} from 'fs';
import {info} from '@travi/cli-messages';
import execa from '../thirdparty-wrappers/execa';

export default async function (projectRoot) {
info('Configuring Ruby version');

await promises.writeFile(`${projectRoot}/.ruby-version`, '2.6.3');
info('Defined the preferred Ruby version', {level: 'secondary'});

await execa('rbenv', ['install', '--skip-existing']);
info('Installed expected Ruby version', {level: 'secondary'});
}
3 changes: 3 additions & 0 deletions src/scaffolder.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import {info} from '@travi/cli-messages';
import scaffoldRubyVersion from './ruby-version';
import scaffoldRake from './rake';
import scaffoldGem from './gems';
import scaffoldDocumentation from './documentation';

export async function scaffold({projectRoot}) {
info('Initializing Ruby project');

const [rakeResults] = await Promise.all([
scaffoldRake(projectRoot),
scaffoldRubyVersion(projectRoot)
Expand Down

0 comments on commit 52cc753

Please sign in to comment.