gulpjs / liftoff

Launch your command line tool with ease.
MIT License
843 stars 52 forks source link

feat: expands tilde of extends property in config file to homedir #126

Closed sttk closed 1 year ago

sttk commented 1 year ago

This PR enables to use ~ at heading of extends propery in a config file.

By this modification, users can specify a config file in each home directory of members for extends of a config file in a project directory.

phated commented 1 year ago

@sttk do you have a use case for this?

sttk commented 1 year ago

@phated This PR is by my mistake, so I'll close this.

In the PR of gulp-cli, I changed .configFiles setting according with Liftoff v4 as follows:

var cli = new Liftoff({
  ...
  configFiles: {
    '.gulp': [
      {
        path: '.',
        extensions: interpret.extensions,
        findUp: true,
      },
      {
        path: '~',
        extensions: interpret.extensions,
      },
    ],
  },
});

and this setting loads only one config file found firstly. So I thought it was needed to use .exntends property to load one more config file in user home directory.

However, this setting is incorrect. This setting should be changed as follows:

var cli = new Liftoff({
  ...
  configFiles: {
    project: [
      {
        name: '.gulp',
        path: '.',
        extensions: interpret.extensions,
        findUp: true,
      },
    ],
    userHome: [
      {
        name: '.gulp',
        path: '~',
        extensions: interpret.extensions,
      },
    ],
  },
});

Therefore, I'll close this PR and modify the PR of gulp-cli.