Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Conversation

@Kompwu
Copy link
Contributor

@Kompwu Kompwu commented Apr 26, 2018

Fix issue #1114

this.engine = options.engine;
this.extension = options.extension || `.${options.engine}`;
this.useDefault = (options.useDefault !== undefined) ? options.useDefault : true;
this.basedir = (options.basedir !== undefined) ? options.basedir : file.context.homeDir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file variable does not exist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nchanged said that it was...
so idk.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't initialize it in the constructor. It has to be done on each file

this.engine = options.engine;
this.extension = options.extension || `.${options.engine}`;
this.useDefault = (options.useDefault !== undefined) ? options.useDefault : true;
this.basedir = (options.basedir !== undefined) ? options.basedir : file.context.homeDir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't initialize it in the constructor. It has to be done on each file

filename: 'base',
basedir: file.context.homeDir,
includeDir: file.context.homeDir
filename: 'base'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did the rest of the options go?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was just like useDefault

file.contents = await consolidate[this.engine].render(file.contents, {
cache: false,
filename: 'base'
filename: 'base',; basedir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove ; basedir;

this.engine = options.engine;
this.extension = options.extension || `.${options.engine}`;
this.useDefault = (options.useDefault !== undefined) ? options.useDefault : true;
this.basedir = (options.basedir !== undefined) ? options.basedir : file.context.homeDir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is needed if you plan on referencing it in transform

this.extension = options.extension || `.${options.engine}`;
this.useDefault = (options.useDefault !== undefined) ? options.useDefault : true;
this.basedir = (options.basedir !== undefined) ? options.basedir : file.context.homeDir;
this.includeDir = (options.includeDir !== undefined) ? options.includeDir : file.context.homeDir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is needed if you plan on referencing it in transform

filename: 'base'
filename: 'base',; basedir;
basedir: (options.basedir !== undefined) ? options.basedir : file.context.homeDir;
includeDir: (options.includeDir !== undefined) ? options.includeDir : file.context.homeDir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options should be this

basedir: (this.basedir !== undefined) ? this.basedir : file.context.homeDir;

same for include

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I'm tired I didn't sleep I code wrong..

filename: 'base',
basedir: file.context.homeDir,
includeDir: file.context.homeDir
basedir: this.basedir || file.context.homeDir,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where do you assign basedir? it's not in the constructor

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like its optional so should be fine. I am fussy, could we capitalise the D in basedir as well for consistency 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's capitlise it ! 😄

filename: 'base',
basedir: file.context.homeDir,
includeDir: file.context.homeDir
basedir: (this.basedir !== undefined) ? this.basedir : file.context.homeDir,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.baseDir is never defined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh? it is ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it's not

filename: 'base',
basedir: file.context.homeDir,
includeDir: file.context.homeDir
basedir: (this.basedir !== undefined) ? this.basedir : file.context.homeDir,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it's not

this.engine = options.engine;
this.extension = options.extension || `.${options.engine}`;
this.useDefault = (options.useDefault !== undefined) ? options.useDefault : true;
this.basedir = options.basedir || file.context.homeDir;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file is undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you reviewed an old commit...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and it's defined.
see here:

basedir: file.context.homeDir,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added tests and everything's fine.
Can you merge it ?

Camelcase is everywhere... right ? 🎨
To make sure everything's okay.
@nchanged
Copy link
Contributor

Looking good!

Can you update the doc please? After that, I will merge it

@Kompwu
Copy link
Contributor Author

Kompwu commented Apr 28, 2018

@nchanged Docs added :)

@nchanged nchanged merged commit 26e7ebe into fuse-box:master Apr 28, 2018
@Kompwu Kompwu deleted the patch-1 branch April 28, 2018 15:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants