Skip to content

Commit f968a33

Browse files
authored
Merge pull request #39 from StatelessSoftware/v0.4.0
V0.4.0
2 parents 1e49021 + aaa8ec2 commit f968a33

4 files changed

Lines changed: 28 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog - html-to-app
22

3+
## [0.4.0] - 2018-04-04
4+
5+
### Additions
6+
7+
- [Issue #36] - Layout file should not be required
8+
9+
### Fixes
10+
11+
- [Issue #38] - Throws exception if app directory does not exist or is empty
12+
313
## [0.3.0] - 2018-03-30
414

515
### Additions

lib/chainlinks/builder.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,20 @@ let Builder = function() {
5858
}
5959

6060
// Check for an app directory to merge
61+
this._mergeCmd = false;
6162
if (this.dirMerge && this.dirMerge.length &&
6263
fs.existsSync(this.dirMerge)) {
6364

6465
// Create app directory path
6566
let mergePath = path.normalize(this.dirMerge);
67+
68+
// Check directory contents
69+
if (fs.readdirSync(mergePath).length) {
6670

67-
// Merge the directory
68-
this._mergeCmd = "cp -rf ../" + mergePath + "/* .";
71+
// Merge the directory
72+
this._mergeCmd = "cp -rf ../" + mergePath + "/* .";
73+
74+
}
6975

7076
}
7177

@@ -75,28 +81,25 @@ let Builder = function() {
7581
// Install
7682
if (
7783
this.binCmd(this.installCmd) &&
78-
this.binCmd(this.cleanupCmd) &&
79-
(this._mergeCmd && this.binCmd(this._mergeCmd)))
84+
this.binCmd(this.cleanupCmd))
8085
{
81-
82-
accept(payload);
8386

8487
}
8588
else {
8689
reject("Could not install");
8790
}
8891

8992
}
90-
else {
9193

92-
// Merge build
93-
if (this._mergeCmd && this.binCmd(this._mergeCmd)) {
94-
accept(payload);
95-
}
96-
else {
97-
reject("Could not merge");
98-
}
94+
// Merge build
95+
if (this._mergeCmd && this.binCmd(this._mergeCmd)) {
96+
9997
}
98+
else if (this._mergeCmd) {
99+
reject("Could not merge");
100+
}
101+
102+
accept(payload);
100103

101104
});
102105
}

lib/chainlinks/importer.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ let Importer = function() {
110110
payload.import.names.push(this.layoutFile.split(".")[0]);
111111

112112
}
113-
else {
114-
reject("Layout file " + this.fixFilename(this.layoutFile) +
115-
" does not exist.");
116-
}
117113

118114
// Load the view files
119115
this._views = fs.readdirSync(this.fixFilename());

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html-to-app",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "Convert HTML flat file sites to Apps",
55
"main": "lib/index.js",
66
"bin": {

0 commit comments

Comments
 (0)