Skip to content

Commit 7592061

Browse files
authored
Merge pull request #26 from Mindsers/release/v0.2.1
Release v0.2.1
2 parents 92b57dc + 8357038 commit 7592061

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [0.2.1] - 2017-10-13
10+
### Fixed
11+
- Replace the JS error message (non-handled error) on `scripts` and `modules` commands
12+
by a user friendly error message.
13+
914
## [0.2.0] - 2017-10-12
1015
### Added
1116
- This CHANGELOG file to hopefully serve to all developers and users.
@@ -31,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3136
- The README file to give first information on the project (installation, usage, etc.).
3237

3338
[Unreleased]: https://github.com/Mindsers/configfile/tree/develop
39+
[0.2.1]: https://github.com/Mindsers/configfile/tree/0.2.1
3440
[0.2.0]: https://github.com/Mindsers/configfile/tree/0.2.0
3541
[0.1.1]: https://github.com/Mindsers/configfile/tree/0.1.1
3642
[0.1.0]: https://github.com/Mindsers/configfile/tree/0.1.0

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "configfile",
3-
"version": "0.2.0",
4-
"description": "Config files manager",
3+
"version": "0.2.1",
4+
"description": "Personal config files manager",
55
"main": "index.js",
6-
"repository": "github.com:Mindsers/configfiles.git",
6+
"repository": "github.com:Mindsers/configfile.git",
77
"author": "Mindsers <[email protected]>",
88
"license": "Apache-2.0",
99
"bin": {

src/modules.command.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
const { LogUtils } = require('./shared/log.utils')
22

3+
const { ConfigurationFileNotExist } = require('./services/config')
4+
35
module.exports = exports = fileService => () => {
4-
const modules = fileService.modules
6+
let modules = []
7+
8+
try {
9+
modules = fileService.modules
10+
} catch (e) {
11+
if (e instanceof ConfigurationFileNotExist) {
12+
LogUtils.log({ message: 'Unable to load modules without knowing where are stored the data.' })
13+
LogUtils.log({ type: 'error', message: 'No configuration file. You need to run the init command before.' })
14+
return
15+
}
16+
}
517

618
if (modules.length < 1) {
719
LogUtils.log({ type: 'info', message: `No module found.` })

src/scripts.command.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
const { LogUtils } = require('./shared/log.utils')
22

3+
const { ConfigurationFileNotExist } = require('./services/config')
4+
35
module.exports = exports = fileService => () => {
4-
const scripts = fileService.scripts
6+
let scripts = []
7+
8+
try {
9+
scripts = fileService.scripts
10+
} catch (e) {
11+
if (e instanceof ConfigurationFileNotExist) {
12+
LogUtils.log({ message: 'Unable to load scripts without knowing where are stored the data.' })
13+
LogUtils.log({ type: 'error', message: 'No configuration file. You need to run the init command before.' })
14+
return
15+
}
16+
}
517

618
if (scripts.length < 1) {
719
LogUtils.log({ type: 'info', message: `No scripts found.` })

0 commit comments

Comments
 (0)