Skip to content

Commit 5ad363d

Browse files
acburdineErisDS
authored andcommitted
fix(template): log successful created template in all cases
no issue - previously it would only log if the template was being linked to somewhere on the system, this led to some confusing/inconsistent behavior
1 parent 2200408 commit 5ad363d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/instance.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,12 @@ class Instance {
266266
() => fs.writeFile(tmplFile, contents)
267267
];
268268

269+
// Dir is optional, if a file just needs to be created locally
270+
// so we log here
271+
this.ui.success(`Creating ${descriptor} file at ${tmplFile}`);
272+
269273
if (dir) {
270274
let outputLocation = path.join(dir, file);
271-
this.ui.success(`Creating ${descriptor} file at ${tmplFile}`);
272275
promises.push(() => this.ui.sudo(`ln -sf ${tmplFile} ${outputLocation}`));
273276
}
274277

test/unit/instance-spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ describe('Unit: Instance', function () {
474474
let fpath = path.join(dir, 'system', 'files', 'file.txt');
475475
expect(fs.existsSync(fpath)).to.be.true;
476476
expect(fs.readFileSync(fpath, 'utf8')).to.equal('some contents');
477-
expect(successStub.called).to.be.false;
477+
expect(successStub.calledOnce).to.be.true;
478478
});
479479
});
480480

0 commit comments

Comments
 (0)