question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support locating multiple configuration files

See original GitHub issue

configuration like this:

new Liftoff({
  configFiles: {
    '.app': {
      extensions: ['rc','.yml'],
      search: {
        cwd: {
          path: './',
          findUp: true
        },
        myHomeKey: '~',
        etc: '/etc'
      }
    },
    'appfile': {
      extensions: function () {
        return Object.keys(require.extensions)
      },
      searchPaths: {
        baseDir: {
          path: './',
          findUp: true
        },
        home: '~',
        alternate: '/path/to/alternate',
        multiple: ['/path/to/whatever', '/path/to/something', '/path/to/something/else']
      }
    }
  }
});

yields environment like this:

env.configFiles = {
  '.app': {
    cwd: '/var/www/project/code/.apprc',
    myHomeKey: '/Users/user/.apprc',
    etc: null
  },
  'appfile': {
    baseDir: '/var/www/project/code/appfile.js',
    home: null,
    alternate: null,
    multiple: ['/path/to/whatever/appfile.js', '/path/to/something/appfile.js']
  }
};

~ expands to process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE searchPath entries which specify an array of paths should NOT perform findUp on each entry.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
phatedcommented, Jul 27, 2016

Support for this was just published as 2.3.0

0reactions
sttkcommented, Apr 17, 2016

@phated Thank you for answering my questions.

That would mean dropping the array syntax … or stopping traversal after the first match; which do you think is better?

If every result is a singular string, I also think that dropping the array syntax is better because it makes less confusing for users and I can’t think the cases in which the syntax is used.

… If there is a gulpfile.js and a gulpfile.babel.js in a project, which is used?

Liftoff preferentially uses an earlier extension in specified order. (Though it isn’t guaranteed.)

I don’t think configFiles should accept an array or string and should only accept an object.

I got it. I’ll do so.

… nothing in the key is expanded (e.g. ~ is not expanded to home) and only valid path characters should be allowed as keys.

I got it. I’ll implement not to expanded ‘~’ and ‘.’ but to use the key just as user specify.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple configuration files
Transitions from one software release to another can be performed while maintaining a separate configuration for the different software release versions.
Read more >
Support Multiple Config Files/An import statement · Issue #2701
You have an import statement somewhere in the config file and it references a path to find other config. Support a list of...
Read more >
Spring Boot and multiple external configuration files
To add different files you can use the spring.config.location properties which takes a comma separated list of property files or file location (directories) ......
Read more >
Solved: Locating SAS Configuration Files - SAS Communities
There can be multiple config files chained from one to another - this is typical when working in the SAS Platform (Metadata Server, ......
Read more >
Can you define a server's locations in multiple nginx config files?
And inside separate config you can use any valid code blocks: upstream app1 { server 127.0.0.1:8080; } location /app1 { proxy_pass ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found