Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

drop shx dependency

Christopher Hiller7f991e0efd07
diff --git a/package.json b/package.json
index 84c81fc7..24ff16f9 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/scripts/package-scripts.js b/scripts/package-scripts.js
index db487e3b..fabc9aff 100644
--- a/scripts/package-scripts.js
+++ b/scripts/package-scripts.js
@@ -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'
}
};
diff --git a/scripts/postinstall.js b/scripts/postinstall.js
new file mode 100755
index 00000000..80617464
--- /dev/null
+++ b/scripts/postinstall.js
@@ -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')}.`);