Skip to content

Commit b58ad9e

Browse files
author
max
committed
feat(publish): Fix published package
1 parent 7eee378 commit b58ad9e

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ $ npm i vorpal-rc
1414

1515
## Usage
1616
```javascript
17-
var vorpal = require('vorpal')();
18-
var rc = require('vorpal-rc');
17+
import Vorpal from 'vorpal';
18+
import rc from 'vorpal-rc';
19+
20+
const vorpal = new Vorpal();
1921

2022
// first declare your commands
2123
vorpal

dist/rc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict';
2+
3+
Object.defineProperty(exports, "__esModule", {
4+
value: true
5+
});
6+
7+
exports.default = function (vorpal, rcfile) {
8+
if (typeof rcfile !== 'string') {
9+
throw new Error('Missing .rc filename');
10+
}
11+
12+
try {
13+
(0, _fs.readFileSync)(rcfile, 'utf-8').split(_os.EOL).filter(function (cmd) {
14+
return (0, _trim2.default)(cmd).length;
15+
}).forEach(function (cmd) {
16+
return vorpal.exec(cmd);
17+
});
18+
} catch (err) {
19+
console.warn(err.message);
20+
}
21+
};
22+
23+
var _fs = require('fs');
24+
25+
var _os = require('os');
26+
27+
var _trim = require('trim');
28+
29+
var _trim2 = _interopRequireDefault(_trim);
30+
31+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": ".rc file support for Vorpal.js",
44
"main": "./dist/rc.js",
55
"scripts": {
6-
"prebuild": "rm -rf dist",
6+
"prebuild": "rimraf dist",
77
"build": "babel src -d dist",
88
"example": "babel-node examples/shell.js",
99
"check-coverage": "istanbul check-coverage --statements 100 --functions 100 --lines 100",
@@ -26,6 +26,10 @@
2626
"bugs": {
2727
"url": "https://github.com/subk/vorpal-rc/issues"
2828
},
29+
"files": [
30+
"dist",
31+
"README.md"
32+
],
2933
"homepage": "https://github.com/subk/vorpal-rc#readme",
3034
"devDependencies": {
3135
"babel-cli": "^6.6.5",
@@ -36,6 +40,7 @@
3640
"cz-conventional-changelog": "^1.1.5",
3741
"istanbul": "^1.0.0-alpha.2",
3842
"mocha": "^2.4.5",
43+
"rimraf": "^2.5.2",
3944
"semantic-release": "^4.3.5",
4045
"test-console": "^1.0.0",
4146
"vorpal": "^1.10.10"

0 commit comments

Comments
 (0)