Skip to content

rootpath does nothing #220

@aharris

Description

@aharris

Example:

inlineSource(path, {
    rootpath: 'fofdsafndsgnsfdlkjgfjndlksgjno'
  })
    .then((html) => {
      // Do something with html
      console.log('html: ', html);
    })
    .catch((err) => {
      console.log('err: ', err);
      // Handle error
    });

We pass it into the context but it doesn't look like anything happens with it:

 const ctx = context.create(options);

    console.log('ctx: ', ctx.rootpath); // This has the correct path

    // Load html content
    if (isFilepath(htmlpath)) {
      ctx.htmlpath = path.resolve(htmlpath);
      try {
        ctx.html = ctx.fs.readFileSync(ctx.htmlpath, 'utf8');
      } catch (err) {
        return reject(err);
      }
      // Passed file content instead of path
    } else {
      ctx.html = htmlpath;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions