Skip to content

Commit

Permalink
fix: Use verify npm script to ensure package name has @pearson-compon…
Browse files Browse the repository at this point in the history
…ents scope.
  • Loading branch information
aaronkaka committed Apr 22, 2016
1 parent d01556d commit 772586f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions npm_scripts/verify.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
const log = require('./log');
const path = require('path');
const fs = require('fs');
const pkg = require('../package.json');
const bowerPath = path.join(process.cwd(), '/bower.json');

if (pkg.name.indexOf('@pearson-components/') === -1) {
log.primaryError('Package name must be pre-pended with "@pearson-components" scope.');
process.exit(1);
}

if (!fs.existsSync(bowerPath)) {
log.secondary('Validated project.');
process.exit(0);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@pearson-components/",
"name": "",
"version": "0.0.0",
"description": "",
"main": "./main.js",
Expand Down

0 comments on commit 772586f

Please sign in to comment.