Skip to content

main.paths creation order #50

Description

@jaumard

When the temp folder is not given by the user, it was added by this repo. But it was create after config.main.paths values. https://github.com/trailsjs/trailpack-core/blob/master/index.js#L47

That's mean if I have :

paths: {
    root: process.cwd(),
    www: path.resolve(process.cwd(), '.tmp', 'public')
  }

This will crash because core try to first create www path and then temp path so a Error: ENOENT: no such file or directory, mkdir '/.tmp/public'

But if now I change and set this :

paths: {
    root: process.cwd(),
    temp: path.resolve(process.cwd(), '.tmp'),
    www: path.resolve(process.cwd(), '.tmp', 'public')
  }

All is working because temp is create before www.

My opinion is if temp, socket and log are added by core so they have to be create first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions