Skip to content
This repository has been archived by the owner on Jan 4, 2018. It is now read-only.

Commit

Permalink
drop shx dependency
Browse files Browse the repository at this point in the history
- also add some descriptions to `scripts/package-scripts.js`
  • Loading branch information
boneskull committed Nov 9, 2016
1 parent 199eabf commit 7f991e0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"devDependencies": {
"chalk": "^1.1.3",
"markdown-toc": "^0.13.0",
"p-s": "^3.0.1",
"shx": "^0.2.0"
"p-s": "^3.0.1"
},
"engines": {
"node": ">=4.0.0",
Expand Down
28 changes: 18 additions & 10 deletions scripts/package-scripts.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
'use strict';

const chalk = require('chalk');
const pkg = require('../package.json');
const join = require('path').join;

module.exports = {
scripts: {
postinstall: `shx echo "\uD83D\uDC49 ${chalk.yellow(pkg.name)} installation:
1. Follow directions for your platform at ${chalk.underline('https://git.io/vKcdH')} to install prereqs.
2. Execute ${chalk.bold('bundle install')} in this directory.
3. Execute ${chalk.bold('npm start serve')} to serve the site locally."`,
serve: 'bundle exec jekyll serve --safe --drafts --watch',
build: 'bundle exec jekyll build --safe --drafts',
toc: require.resolve('./toc')
exports.scripts = {
serve: {
script: 'bundle exec jekyll serve --safe --drafts --watch',
description: `Build site via Jekyll, watch for changes, serve at ${chalk.underline(
'http://localhost:4000/')}`
},
build: {
script: 'bundle exec jekyll build --safe --drafts',
description: 'Build site via Jekyll'
},
toc: {
script: join(__dirname, 'toc.js'),
description: `Rebuild table of contents; mutates ${chalk.bold('index.md')}`
},
postinstall: {
script: join(__dirname, 'postinstall.js'),
description: 'Displays help after installing'
}
};
20 changes: 20 additions & 0 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

/**
* Displays some guidance after install
*/

'use strict';

const chalk = require('chalk');
const yellow = chalk.yellow;
const bold = chalk.bold;
const hipEmoji = '\uD83D\uDC49';
const pkg = require('../package.json');

console.log(`${hipEmoji} ${chalk.yellow(pkg.name)} installation:
1. Follow instructions for your platform in ${chalk.bold('README.md')}.
2. Execute ${chalk.bold('bundle install')} in this directory to install Jekyll (https://jekyllrb.com/) & its deps.
3. Execute ${chalk.bold('npm start serve')} to build, watch & serve the site.
For more help, execute ${chalk.bold('npm start')}.`);

0 comments on commit 7f991e0

Please sign in to comment.