Closed
Description
Kind-of the opposite of #452 (which fixes #450), but I'd be fine with the current behavior by default provided there can be some means (file name or extension) of sourcing instead of executing.
Rationale:
I have an initialization script that needs file_env()
, $POSTGRES_DB
, and ${psql[@]}
.
When the script is source
d it works, but as none of those are export
ed, it doesn't work if it's executed. We've had to take care to chmod -x
the file to work around this after #452, but that seems kind-of hacky and hard to maintain.
Possible options:
- Informal naming convention, e.g.
source_*.sh
,*.source.sh
,.*
, or similar- Might be hard to document, know about
- Could be triggered accidentally by unaware users
- Separate directory or subdirectory
- Export (optionally?) useful functions/variables
- Hard to maintain
- Maybe undesirable by default for some users?
- Have the default case try to source
$f
instead of ignoring it- Maybe users are exploiting current behavior and putting weird files here for some reason
Thoughts?