Skip to content

Conversation

@mbland
Copy link
Owner

@mbland mbland commented Jan 22, 2017

Part of #120, and similar to #122, searching the local _GO_SCRIPT_DIR before plugin dirs seems like a more natural and scalable model. _GO_CORE_DIR/libexec for builtins still comes first.

The idea behind this model is that when reading a script within the ./go script framework, it should be clear that:

  • core framework scripts are the same everywhere; they can't be shadowed by scripts with the same name
  • project-local scripts take precedence before any plugin scripts

The implications of this last point are that:

  • a script that is installed as a plugin will find its own scripts before those that share the same name with other installed plugins, avoiding collisions and possibly obscure bugs
  • the parent project can determine the precedence of plugin scripts sharing the same name, as the plugins can be installed using directory names that force a particular order (e.g. '00-', '01-', '02-' prefixes).
  • as an alternative to the approach in the preceding point, the parent project can potentially resolve conflicts by installing its own scripts that then delegate to a specific plugin script

And to this last point, I've filed #127 to facilitate help text discovery.

Part of #120, and similar to #122, searching the local `_GO_SCRIPT_DIR`
before plugin dirs seems like a more natural and scalable model.
`_GO_CORE_DIR/libexec` for builtins still comes first.

The idea behind this model is that when reading a script within the
`./go` script framework, it should be clear that:

- core framework scripts are the same everywhere; they can't be shadowed
  by scripts with the same name
- project-local scripts take precedence before any plugin scripts

The implications of this last point are that:

- a script that is installed as a plugin will find its own scripts
  before those that share the same name with other installed plugins,
  avoiding collisions and possibly obscure bugs
- the parent project can determine the precedence of plugin scripts
  sharing the same name, as the plugins can be installed using directory
  names that force a particular order (e.g. '00-', '01-', '02-'
  prefixes).
- as an alternative to the approach in the preceding point, the parent
  project can potentially resolve conflicts by installing its own
  scripts that then delegate to a specific plugin script

And to this last point, I've filed #127 to facilitate help text
discovery.
@mbland mbland added this to the v1.4.0 milestone Jan 22, 2017
@mbland mbland self-assigned this Jan 22, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.308% when pulling 0c3932f on reorder-scripts-paths into 96fe117 on master.

@mbland mbland merged commit dab84db into master Jan 22, 2017
@mbland mbland deleted the reorder-scripts-paths branch January 22, 2017 17:39
@mbland mbland mentioned this pull request Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants